TCP : two different sockets sharing a port?

server socket listens on a single port. All established client connections on that server are associated with that same listening port on the server side of the connection. An established connection is uniquely identified by the combination of client-side and server-side IP/Port pairs. Multiple connections on the same server can share the same server-side IP/Port pair as long as they are associated with different client-side IP/Port pairs, and the server would be able to handle as many clients as available system resources allow it to.

On the client-side, it is common practice for new outbound connections to use a random client-side port, in which case it is possible to run out of available ports if you make a lot of connections in a short amount of time.

 

来自:http://stackoverflow.com/questions/11129212/tcp-two-different-sockets-sharing-a-port

posted @ 2016-05-30 08:52  悟寰轩-叶秋  阅读(331)  评论(0编辑  收藏  举报