Does this mean for each port there can be multiple sockets(so to say, local port numbers) in each machine?
Yes that is true! For instance, three connections among three hosts denoted by ip1, ip2 and ip3:
ip1: port1 <---> ip2: port1234
ip1: port2 <---> ip2: port1234
ip2: port1 <---> ip2: port1234
A connection is made up by two ips and two ports. The two comunications between hosts ip1 and ip2 are distinguishable because the first one has port1 at the host ip1; while the second has port2.
I have printed (*) the local port of the connected Socket returned by serverSocket.accept() and all of them are the same as the one on which the serverSocket is listening. As long as all the clients are distinguishable there shouldn't be a problem.
(*) Via Socket.getLocalPort()
[ April 02, 2004: Message edited by: Jose Botella ]