On Windows, Java's NIO uses TCP (which can be surprising to anyone who hasn't seen that before). For each Selector, you'll get a pair of ports opened, communicating with each other.
If you look at netstat
or similar you should see that those additional ports are connected to each other in pairs. Those ports should be stable across the life of the process (assuming you aren't dynamically starting and stopping Connectors) and aren't something you can get rid of.
I can't seem to find a great reference for this, but here is a not-great one: https://developer.jboss.org/thread/268935
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.