@Override public void sessionIdle(final IoSession session, final IdleStatus status) throws Exception { // We close idle sessions to make sure we don't consume // too many client resources. // Note closing the session here will create the // appropriate event handlers to clean up all mappings // and references. session.close(); }
public void expired(IoSession expiredSession) { expiredSession.close(); } }
public void sessionIdle(final IoSession session, final IdleStatus status) throws Exception { // We close idle sessions to make sure we don't consume // too many client resources. // Note closing the session here will create the // appropriate event handlers to clean up all mappings // and references. session.close(); }
@Override public void sessionIdle(final IoSession session, final IdleStatus status) { m_log.debug("Killing idle session"); // Kill idle sessions. session.close(); } }
public void sessionIdle(final IoSession session, final IdleStatus status) throws Exception { m_log.debug("Closing idle session"); session.close(); }
public void exceptionCaught(final IoSession session, final Throwable cause) throws Exception { if (!(cause instanceof IOException)) { m_log.warn("Unexpected exception:", cause); } session.close(); }
@Override public void sessionIdle(final IoSession session, final IdleStatus status) { LOG.debug("Session idle...closing TURN connection to server..."); // final AllocateRequest request = new AllocateRequest(); // session.write(request); // We used to issue a new allocate request in this case to make sure // the server keeps the TURN connection up. This only makes sense // for maintaining long-lived TURN connections, though. In our case, // if a connection is idle, it's not being used for a file transfer, // so we should close it. // Note we ideally should not rely on this behavior, instead closing // TURN connections whenever we know they're not used. session.close(); }
public void close() { LOG.info("Closing sessions..."); synchronized (m_sessions) { for (final IoSession session : m_sessions) { LOG.info("Closing: {}", session); session.close(); } } }
public void close() { // Now close any of the local "proxied" sockets as well. final Collection<IoSession> sessions = this.m_addressesToSessions.values(); for (final IoSession curSession : sessions) { curSession.close(); } this.m_addressesToSessions.clear(); } }
/** * {@inheritDoc} */ @Override public void close() throws IOException { m_log.debug("Closing socket from: "+ThreadUtils.dumpStack()); this.m_ioSession.close(); }
@Override public StunMessage visitAllocateErrorResponse( final AllocateErrorResponse response) { m_log.warn("Received an Allocate Response error from the server: " + response.getAttributes()); // this.m_connectionListener.connectionFailed(); this.m_ioSession.close(); return null; }
public void close() { if (this.m_ioSession == null) { m_log.debug("Can't close null session"); return; } final CloseFuture future = this.m_ioSession.close(); future.join(); this.m_closed = true; } }
public void close() { m_log.debug("Closing TCP TURN client."); if (this.m_ioSession != null) { final CloseFuture closeFuture = this.m_ioSession.close(); closeFuture.join(); } }
public void onRemoteAddressClosed(final InetSocketAddress remoteAddress) { if (!this.m_addressesToSessions.containsKey(remoteAddress)) { // This would be odd -- could indicate someone fiddling // with our servers? m_log.warn("We don't know about the remote address: {}", remoteAddress); m_log.warn("Address not in: {}", m_addressesToSessions.keySet()); } else { m_log.debug("Closing connection to local HTTP server..."); final IoSession session = this.m_addressesToSessions .remove(remoteAddress); // Stop the local session. In particular, it the session // is in the middle of an HTTP transfer, this will stop // the HTTP server from sending more data to a host that's // no longer there on the other end. session.close(); } }
public void operationComplete(IoFuture future) { future.getSession().close(); } };
private void blockSession(IoSession session) { SessionLog.info(session, "Remote address in the blacklist; closing."); session.close(); }
public void sessionIdle(final IoSession session, final IdleStatus status) { // This can happen, for example, if a user puts their laptop to sleep. // When it wakes up, the session will be seen as idle. m_log.debug("Killing idle session: {}", session); // Kill idle sessions. session.close(); if (this.m_idleSipSessionListener != null) { this.m_idleSipSessionListener.onIdleSession(); } } }
@Override public void exceptionCaught(final IoSession session, final Throwable cause) { m_log.debug("Exception on STUN IoHandler", cause); if (cause instanceof PortUnreachableException) { // We pretend it's like an ordinary STUN "message" and visit it. // We allow the processing classes to close the session as they // see fit. // // This will occur relatively frequently over the course of normal // STUN checks for UDP. final ConnectErrorStunMessage icmpError = new ConnectErrorStunMessage(); messageReceived(session, icmpError); } else { m_log.warn("Exception on STUN IoHandler for session: "+session, cause); session.close(); } }
@Override public void close() throws IOException { try { flush(); } finally { session.close().join(); } }
@Override public void close() throws IOException { m_log.debug("Closing output stream from: "+ThreadUtils.dumpStack()); try { flush(); } finally { m_ioSession.close().join(); } }