I think I remember this is just how java NIO works on Windows so there is nothing we can do about it in Netty.
On Windows, the epoll
system call does not exist. Thus, in order to get notifications from the network, this is the workaround that has been implemented.
In order to reproduce, just open a Selector
:
Selector selector = Selector.open();
Thread.sleep(Integer.MAX_VALUE);
And you will observe the cross referenced TCP connections on windows:
TCP 127.0.0.1:51431 127.0.0.1:51432 ESTABLISHED
[javaw.exe]
TCP 127.0.0.1:51432 127.0.0.1:51431 ESTABLISHED
[javaw.exe]
Normally, those connections should close as soon as you close the Selector
:
selector.close();