Do you mean how can one server handle multiple connections at the same time? There is a bit of black magic in there (something I don't understand) but what we see is this ...
Our server opens one ServerSocket. Any time a client connects, the ServerSocket creates a new Socket and hooks the client up to that new Socket. After that we can converse with the client on the new socket and the original ServerSocket is available to accept another request.
That bit about hooking the client up to the new socket is the magic ... I have no clue how that's done. Down in the IP stack? In the JRE? In
Java? Guess I've never needed to care.
Editing hours later because I forgot two things: 1) Welcome to the Ranch!! and 2) Did that answer the right question?
[ February 13, 2007: Message edited by: Stan James ]