/** * {@inheritDoc} */ @Override public void remove(NioSession session) { getSessionRecycler().remove(session); getListeners().fireSessionDestroyed(session); }
private IoSession newSessionWithoutLock(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception { DatagramChannel handle = boundHandles.get(localAddress); if (handle == null) { throw new IllegalArgumentException("Unknown local address: " + localAddress); } IoSession session; synchronized (sessionRecycler) { session = sessionRecycler.recycle(remoteAddress); if (session != null) { return session; } // If a new session needs to be created. NioSession newSession = newSession(this, handle, remoteAddress); getSessionRecycler().put(newSession); session = newSession; } initSession(session, null, null); try { this.getFilterChainBuilder().buildFilterChain(session.getFilterChain()); getListeners().fireSessionCreated(session); } catch (Exception e) { ExceptionMonitor.getInstance().exceptionCaught(e); } return session; }
private IoSession newSessionWithoutLock(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception { DatagramChannel handle = boundHandles.get(localAddress); if (handle == null) { throw new IllegalArgumentException("Unknown local address: " + localAddress); } IoSession session; synchronized (sessionRecycler) { session = sessionRecycler.recycle(remoteAddress); if (session != null) { return session; } // If a new session needs to be created. NioSession newSession = newSession(this, handle, remoteAddress); getSessionRecycler().put(newSession); session = newSession; } initSession(session, null, null); try { this.getFilterChainBuilder().buildFilterChain(session.getFilterChain()); getListeners().fireSessionCreated(session); } catch (Exception e) { ExceptionMonitor.getInstance().exceptionCaught(e); } return session; }
private IoSession newSessionWithoutLock( SocketAddress remoteAddress, SocketAddress localAddress) throws Exception { H handle = boundHandles.get(localAddress); if (handle == null) { throw new IllegalArgumentException("Unknown local address: " + localAddress); } IoSession session; IoSessionRecycler sessionRecycler = getSessionRecycler(); synchronized (sessionRecycler) { session = sessionRecycler.recycle(localAddress, remoteAddress); if (session != null) { return session; } // If a new session needs to be created. T newSession = newSession(processor, handle, remoteAddress); getSessionRecycler().put(newSession); session = newSession; } initSession(session, null, null); try { this.getFilterChainBuilder().buildFilterChain(session.getFilterChain()); getListeners().fireSessionCreated(session); } catch (Throwable t) { ExceptionMonitor.getInstance().exceptionCaught(t); } return session; }
/** * {@inheritDoc} */ @Override public void remove(NioSession session) { getSessionRecycler().remove(session); getListeners().fireSessionDestroyed(session); }
private IoSessionEx newSessionWithoutLock( SocketAddress remoteAddress, SocketAddress localAddress) throws Exception { Handle handle = boundHandles.get(localAddress); if (handle == null) { throw new IllegalArgumentException("Unknown local address: " + localAddress); } IoSessionEx session; IoSessionRecycler sessionRecycler = getSessionRecycler(); synchronized (sessionRecycler) { session = (IoSessionEx) sessionRecycler.recycle(localAddress, remoteAddress); if (session != null && !session.isClosing()) { return session; } // If a new session needs to be created. MulticastSession newSession = new MulticastSession(this, processor, handle.socket, handle.localAddress, remoteAddress); sessionRecycler.put(newSession); session = newSession; } initSession(session, null, null); try { this.getFilterChainBuilder().buildFilterChain(session.getFilterChain()); getListeners().fireSessionCreated(session); } catch (Throwable t) { ExceptionMonitor.getInstance().exceptionCaught(t, session); } return session; }
@Override public void remove(MulticastSession session) { session.getSocket().close(); getSessionRecycler().remove(session); getListeners().fireSessionDestroyed(session); }