This is probably not the correct interpretation of this error.
The Win32 error above is more likely to indicate the actual problem.
Flags
Severity
Success
This code indicates success, rather than an error.
This may not be the correct interpretation of this code,
or possibly the program is handling errors incorrectly.
I have the following class: public class TCPHandler extends IoHandlerAdapter{ static AtomicInteger sessions = new AtomicInteger(); @Override public void exceptionCaught(final IoSession session, final Throwable cause) throws Exception { cause.printStackTrace(); //System.out.println(session.isConnected()); //true //System.out.println(session.isClosing()); //false session.close(true).addListener(new IoFutureListener<CloseFuture>() { //immediately! @Override public void operationComplete(final CloseFuture future) { System.out.println("TCP! " + sessions.decrementAndGet()); //Never happens! [...] read more