• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Socket

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How different number of client connections can be possible with server?
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic