@Override public void closeConnections(int n) { while (n-- > 0) { ConnectionHandler handler; synchronized (connectedHandlers) { handler = connectedHandlers.iterator().next(); } if (handler != null) handler.closeConnection(); // Removes handler from connectedHandlers before returning } }
@Override public void closeConnections(int n) { while (n-- > 0) { ConnectionHandler handler; synchronized (connectedHandlers) { handler = connectedHandlers.iterator().next(); } if (handler != null) handler.closeConnection(); // Removes handler from connectedHandlers before returning } }
@Override public void closeConnections(int n) { while (n-- > 0) { ConnectionHandler handler; synchronized (connectedHandlers) { handler = connectedHandlers.iterator().next(); } if (handler != null) handler.closeConnection(); // Removes handler from connectedHandlers before returning } }
@Override public void closeConnections(int n) { while (n-- > 0) { ConnectionHandler handler; synchronized (connectedHandlers) { handler = connectedHandlers.iterator().next(); } if (handler != null) handler.closeConnection(); // Removes handler from connectedHandlers before returning } }
andUnlock = false; log.warn("Error writing message to connection, closing connection", e); closeConnection(); throw e; } catch (CancelledKeyException e) { andUnlock = false; log.warn("Error writing message to connection, closing connection", e); closeConnection(); throw new IOException(e); } finally {
andUnlock = false; log.warn("Error writing message to connection, closing connection", e); closeConnection(); throw e; } catch (CancelledKeyException e) { andUnlock = false; log.warn("Error writing message to connection, closing connection", e); closeConnection(); throw new IOException(e); } finally {
return; if (!key.isValid()) { handler.closeConnection(); // Key has been cancelled, make sure the socket gets closed return; else if (read == -1) { // Socket was closed key.cancel(); handler.closeConnection(); return; handler.closeConnection();
return; if (!key.isValid()) { handler.closeConnection(); // Key has been cancelled, make sure the socket gets closed return; else if (read == -1) { // Socket was closed key.cancel(); handler.closeConnection(); return; handler.closeConnection();
andUnlock = false; log.warn("Error writing message to connection, closing connection", e); closeConnection(); throw e; } catch (CancelledKeyException e) { andUnlock = false; log.warn("Error writing message to connection, closing connection", e); closeConnection(); throw new IOException(e); } finally {
andUnlock = false; log.warn("Error writing message to connection, closing connection", e); closeConnection(); throw e; } catch (CancelledKeyException e) { andUnlock = false; log.warn("Error writing message to connection, closing connection", e); closeConnection(); throw new IOException(e); } finally {
return; if (!key.isValid()) { handler.closeConnection(); // Key has been cancelled, make sure the socket gets closed return; else if (read == -1) { // Socket was closed key.cancel(); handler.closeConnection(); return; handler.closeConnection();
return; if (!key.isValid()) { handler.closeConnection(); // Key has been cancelled, make sure the socket gets closed return; else if (read == -1) { // Socket was closed key.cancel(); handler.closeConnection(); return; handler.closeConnection();
} else { log.warn("Failed to connect to {}", sc.socket().getRemoteSocketAddress()); handler.closeConnection(); // Failed to connect for some reason data.future.setException(new ConnectException("Unknown reason")); data.future = null; handler.closeConnection(); data.future.setException(cause); data.future = null;
} else { log.warn("Failed to connect to {}", sc.socket().getRemoteSocketAddress()); handler.closeConnection(); // Failed to connect for some reason data.future.setException(new ConnectException("Unknown reason")); data.future = null; handler.closeConnection(); data.future.setException(cause); data.future = null;
} else { log.warn("Failed to connect to {}", sc.socket().getRemoteSocketAddress()); handler.closeConnection(); // Failed to connect for some reason data.future.setException(new ConnectException("Unknown reason")); data.future = null; handler.closeConnection(); data.future.setException(cause); data.future = null;
} else { log.warn("Failed to connect to {}", sc.socket().getRemoteSocketAddress()); handler.closeConnection(); // Failed to connect for some reason data.future.setException(new ConnectException("Unknown reason")); data.future = null; handler.closeConnection(); data.future.setException(cause); data.future = null;