}
return;
}
// remove it if it exists
if (clients.remove(client)) {
IScopeHandler handler = getHandler();
if (handler != null) {
try {
handler.disconnect(conn, this);
} catch (Exception e) {
log.error("Error while executing \"disconnect\" for connection {} on handler {}. {}", new Object[] { conn, handler, e });
}
try {
// there may be a timeout here ?
handler.leave(client, this);
} catch (Exception e) {
log.error("Error while executing \"leave\" for client {} on handler {}. {}", new Object[] { conn, handler, e });
}
}
// remove listener