Hello All,
Follow-up:
It's indeed caused by the sessionClosed called before the
sessionOpened.
I've added some debug output which showed that the reported number of
connections differs from the actual number of connections by the value
of sessionClosed calls before the sessionOpened calls.
The initialization for acceptor is as follows:
acceptor = new NioSocketAcceptor();
acceptor.getFilterChain().addLast("codec", new ProtocolCodecFilter(...));
accExecutor = new OrderedThreadPoolExecutor(...);
acceptor.getFilterChain().addLast("threadPool", new
ExecutorFilter(accExecutor));
Quoting the ExecutorFilter JavaDoc:
"Event Ordering
All convenience constructors of this filter creates a new
OrderedThreadPoolExecutor instance. Therefore, the order of event is
maintained like the following:
* All event handler methods are called exclusively. (e.g.
messageReceived and messageSent can't be invoked at the same time.)
* The event order is never mixed up. (e.g. messageReceived is always
invoked before sessionClosed or messageSent.)"
Am I right assuming that sessionOpened should be also called before
sessionClosed or am I doing anything wrong?
--
Best regards,
Serge