public void sessionCreated(final IoSession session) throws Exception { SessionUtil.initialize(session); // The idle time is in seconds. If there's been no traffic in either // direction for awhile, we free the connection to limit load on the // server. // Even though SIP governs online status, clients still send traffic to // keep connections open. If they don't, we should close them. // Note the CRLF keep alive time is 120 or less (it's randomized), so // we tolerate 2 failures as well as slightly inaccurate timers. session.setIdleTime(IdleStatus.BOTH_IDLE, 260); }
public void sessionCreated(final IoSession session) throws Exception { m_log.debug("Session created!!"); SessionUtil.initialize(session); // We consider a connection to be idle if there's been no // traffic in either direction for awhile. session.setIdleTime(IdleStatus.BOTH_IDLE, 60); }
@Override public void sessionCreated(final IoSession session) throws Exception { SessionUtil.initialize(session); // The idle time is in seconds. If there's been no traffic in either // direction for awhile, we free the connection. session.setIdleTime(IdleStatus.BOTH_IDLE, 100); }
public void sessionCreated(final IoSession session) { SessionUtil.initialize(session); // We consider a connection to be idle if there's been no // traffic in either direction for awhile. session.setIdleTime(IdleStatus.BOTH_IDLE, 60 * 10); }
/** * Initializes streams and timeout settings. */ public void sessionOpened(IoSession session) { // Set timeouts session.setWriteTimeout(writeTimeout); session.setIdleTime(IdleStatus.READER_IDLE, readTimeout); // Create streams InputStream in = new IoSessionInputStream(); OutputStream out = new IoSessionOutputStream(session); session.setAttribute(KEY_IN, in); session.setAttribute(KEY_OUT, out); processStreamIo(session, in, out); }
/** * Initializes streams and timeout settings. */ @Override public void sessionOpened(final IoSession session) { // Set timeouts session.setWriteTimeout(m_writeTimeout); session.setIdleTime(IdleStatus.READER_IDLE, m_readTimeout); // Create streams final InputStream in = new IoSessionInputStream(session, m_readTimeout); final OutputStream out = this.m_osFactory.newStream(session); session.setAttribute(KEY_IN, in); session.setAttribute(KEY_OUT, out); final Socket ioSocket = new IoSessionSocket(session, in, out); session.setAttribute("SOCKET", ioSocket); //onSocket(ioSocket); }