public void operationComplete(IoFuture future) { BaseIoSession s = (BaseIoSession) future.getSession(); s.scheduledWriteBytes.set(0); s.scheduledWriteRequests.set(0); } };
public void operationComplete(final IoFuture future) { if (LOG.isDebugEnabled()) { final IoSession sess = future.getSession(); LOG.debug("Wrote messages: "+ sess.getWrittenMessages() + " on session " + sess); } }
public void operationComplete(IoFuture future) { future.getSession().close(); } };
public void operationComplete(final IoFuture ioFuture) { if (!ioFuture.isReady()) { m_log.warn("Future not ready?"); return; } try { m_ioSession = ioFuture.getSession(); } catch (final RuntimeIOException e) { // This seems to get thrown when we can't connect at all. m_log.warn("Could not connect to TURN server at: " + stunServerAddress, e); // m_connectionListener.connectionFailed(); return; } if (m_ioSession == null || !m_ioSession.isConnected()) { m_log.error("Could not create session"); throw new RuntimeIoException("Could not get session"); } // TODO: We should not need this. final TurnStunMessageMapper mapper = new TurnStunMessageMapperImpl(); m_ioSession.setAttribute("REMOTE_ADDRESS_MAP", mapper); final AllocateRequest msg = new AllocateRequest(); m_log.debug("Sending allocate request to write handler..."); m_ioSession.write(msg); } };