Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Socket  RSS feed

 
sandip suryawanshi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How different number of client connections can be possible with server?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!