cleanConnections should log them
wsky opened this issue · comments
Harry commented
protected synchronized void RemoveConnection(ClientConnection conn) {
this.connections.remove(conn);
this.logger.info("client#%s remove a connection from %s",
this.getId(), conn.getOrigin());
}
protected synchronized int cleanConnections() {
List<ClientConnection> trash = new ArrayList<ClientConnection>();
Iterator<ClientConnection> iterator = this.connections.iterator();
while (iterator.hasNext()) {
ClientConnection clientConnection = iterator.next();
if (!clientConnection.isOpen())
trash.add(clientConnection);
}
this.connections.removeAll(trash);
return this.connections.size();
}
this.connections.removeAll(trash); should change to use RemoveConnection