On unix system when you call the accept system call, does the newly created socket have a different port number from the listening socket?
+5
A:
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."
WhirlWind
2010-05-27 18:11:52
Reason for downvote?
WhirlWind
2010-05-27 18:19:16
Because I thought, it was wrong. But the more I think about it... I was wrong. Sorry for that. (undownvoted).
Daniel
2010-05-27 18:20:55
Thank you i was looking for a confirmation, because I had a discussion, and I think we confused sockets with connection. From my point of view, a connection is unique, but the handshake is handled in the "listening socket" and then the control passes to the "private socket".
Gainder
2010-05-27 18:58:11