开发者

Accept() method and new socket

开发者 https://www.devze.com 2023-01-01 12:05 出处:网络
On unix system when you call the accept system call, does the newly created socket have a differen开发者_运维百科t port number from the listening socket?No, it has the same port number.

On unix system when you call the accept system call, does the newly created socket have a differen开发者_运维百科t port number from the listening socket?


No, it has the same port number.

TCP/IP connections are differentiated by their source and destination ips, and source and destination port numbers, so each connection to the same port from the same "client" on the "recipient" will have the same port on the "recipient," but a unique* port on the "client."

*Unique, at least, from the perspective of the "recipient."

0

精彩评论

暂无评论...
验证码 换一张
取 消