• Post Reply Bookmark Topic Watch Topic
  • New Topic

Best approach to create a pool of sockets

 
Bruce Rosenthal
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are some solid approaches for creating a pooled Collection of sockets?

I want to do this in the context of an RMI callback application using a custom RMIClientSocketFactory.

Since the createSocket(String host, int port) returns a Socket, I am not sure if I can generate the sockets (say I want 50) using a for loop, or if I need to code the createSocket() for each instance of the sockets I will be creating.

Also, if anyone has a method for stuffing these sockets into the Collection.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!