开发者

Accept() method and new socket

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜