Understanding of WebSockets

后端 未结 2 1947
栀梦
栀梦 2021-02-04 12:17

My understanding is that a socket corresponds to a network identifier, port and TCP identifier. [1]

Operating systems enable a process to be associated with a port (whic

2条回答
  •  梦毁少年i
    2021-02-04 12:56

    You will not enable multiple sockets, there is no need for it. You will have multiple conections. It's a little different, but you undesrstand well. For UDP there's nothing to do, cause there is no connections.

    In TCP, if two different machines connect to the same port on a third machine, there are two distinct connections because the source IPs differ. If the same machine (or two behind NAT or otherwise sharing the same IP address) connects twice to a single remote end, the connections are differentiated by source port, the same machine cannot open 2 connections on the same port.

提交回复
热议问题