Java nio connection is creating multiple socket level connections, Why?

前端 未结 2 1495
梦如初夏
梦如初夏 2020-12-18 15:33

I have written a simple java nio program like the below

 public static void main(String[] args) throws IOException, InterruptedException {


    InetSocketA         


        
2条回答
  •  自闭症患者
    2020-12-18 16:30

    The image is very small but on closer investigation you have

    • two Java processes
    • the first process has a connection to itself. There is a connection for each end, port 52209 and 52210.
    • it also has a connection from the second process on port 1001.
    • the second process is the client you are running with one connection to port 1001

提交回复
热议问题