Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Pool of socket connections

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The server is multi-threaded.
Instead of creating a socket connection for each request, i want to maintain a pool of socket connections? If one client has done with its work, then i want to restore the connection and use for another client.
Could someone explain me how to do pool of socket connections?
Thanks a lot.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why do you want to do something like this. The system will itself allocate the empty ports to the new clients and when a client disconnects the port that it was connected to becomes free
So you do not have to explicitely maintain a pool of ports

Originally posted by Uma Viswanathan:
The server is multi-threaded.
Instead of creating a socket connection for each request, i want to maintain a pool of socket connections? If one client has done with its work, then i want to restore the connection and use for another client.
Could someone explain me how to do pool of socket connections?
Thanks a lot.


 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i dont think u need to create a new connection for each request
it is needed in URLConnection not socket connection
 
Weeds: because mother nature refuses to be your personal bitch. But this tiny ad is willing:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic