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;
}
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;
}