public InetAddress getRemoteAddress() { if (isEstablished()) return activeConnection.getRemoteAddress(); return null; }
public InetAddress getRemoteAddress() { if (isEstablished()) return activeConnection.getRemoteAddress(); return null; }
while (conn == null && c < connections.size()) { Connection nextConn = connections.get(c); if (nextConn.getRemoteAddress().getHostAddress().equals(ipAddress)) conn = nextConn; c++;
while (conn == null && c < connections.size()) { Connection nextConn = connections.get(c); if (nextConn.getRemoteAddress().getHostAddress().equals(ipAddress)) conn = nextConn; c++;
private void discardConnectionIfStale(Connection conn) { if (conn != null && !conn.isOpen()) { log.info("Discarding connection which appears to be closed. Remote addr: {}", conn.getRemoteAddress()); discard(conn); conn = null; } }
private void discardConnectionIfStale(Connection conn) { if (conn != null && !conn.isOpen()) { log.info("Discarding connection which appears to be closed. Remote addr: {}", conn.getRemoteAddress()); discard(conn); conn = null; } }
public void handle() { try { Thread.sleep(500); synchronized (service) { Iterator<Connection> it = service.getRemoteConnections() .iterator(); while (it.hasNext()) { Connection conn = it.next(); if (!conn.isOpen()) { log.debug( "Removing connection from {} from connection list", conn.getRemoteAddress().getHostAddress()); it.remove(); service.notifyListeners(conn); } } } } catch (InterruptedException e) { // don't care } }
public void handle() { try { Thread.sleep(500); synchronized (service) { Iterator<Connection> it = service.getRemoteConnections() .iterator(); while (it.hasNext()) { Connection conn = it.next(); if (!conn.isOpen()) { log.debug( "Removing connection from {} from connection list", conn.getRemoteAddress().getHostAddress()); it.remove(); service.notifyListeners(conn); } } } } catch (InterruptedException e) { // don't care } }