Hello Emmanuel,

Thursday, February 26, 2009, 2:03:23 AM, you wrote:

E> Otherwise, regarding your problem, after a quick search in the mailing
E> list (dev), it seems that there might be a problem with the 
E> sessionClosed being called before the sessionOpened has been totally 
E> executed.

I did some more tests and it appears that sessionClosed is called for
the different session, not the one sessionOpened was called for. Like
for some reason sessionOpened is called for session #1 and
sessionClosed is never called for this session, but the session is
somehow removed from the acceptor and sessionClosed is called for
session #2. sessionClosed doesn't see the attribute I set in the
beginning of sessionOpened. I tested that sessionOpened is not called
after sessionClosed for the same session by adding another attribute
in the sessionClosed.

Even the following code in sessionOpened is leaking connections:

if (IP != null) {
  ClientTracker.getInstance().addConnection(IP, ClientTracker.TYPE.ALLIP);
  session.getCloseFuture().addListener(new IoFutureListener<CloseFuture>() {
    @Override
    public void operationComplete(CloseFuture future) {
      ClientTracker.getInstance().removeConnection(IP, 
ClientTracker.TYPE.ALLIP);
    }
  });
}

JavaDoc for operationComplete says that it's executed even if the
listener was added after the operation completed, so such code should
eliminate the close-before-open potential problem. Still the same
issue remains.

-- 
Best regards,
 Serge

Reply via email to