I was going through an example on socket programming with multi threading.
It has a socket server with multi threading implemented in it.
I fail to understand the following:
1. A listener port is opened on the server say 8888 where the server listens to the incoming requests,from which port does it send the response back to the client? Is it from the same listener port or does it open any other free port to send the response?
2.The example does not open any port explicitly on the client machine,so from which port does the client receive and send the requests?
3.I understand that the server is capable of handling multiple requests because of multithreadig although i cannot understand that how the requests and corrosponding responses are mapped that is how is the manupilation done that client receive the response to their request and not somebody elses response and who does this manupilation?
Basically i need to understand that whats going on behind the scenes for all these activities.
Will appreciate a detailed answer.
The example in question can be found at
http://java.sun.com/docs/books/tutorial/networking/index.html.