Hi folks,
New to socket programming here. Please ignore if its too stupid. In sun site for
What is a socket ? On the client-side: The client knows the hostname of the machine on which the server is running and the port number to which the server is connected. To make a connection request, the client tries to rendezvous with the server on the server's machine and port. If everything goes well, the server accepts the connection. Upon acceptance, the server gets a new socket bound to a different port. It needs a new socket (and consequently a different port number) so that it can continue to listen to the original socket for connection requests while tending to the needs of the connected client.
<<<<<<
But if we print out the port number of the socket side on the server, we get the same port number we requested the connection. I mean upon acceptance of the request from client, the server does not bind the socket to a new port. The socket is still bound with the orginal port on the server. Could some body explain please?
Thanks in advance
Mat
[ May 08, 2005: Message edited by: Mat Matthew ]