Designing a client socket pool

I

iksrazal

I have a class, ClientSocket, that can have up to 20 simultaneous
requests on its method, getData() .

Its purpose is to get data from a mainframe via a socket call. Each
connection needs to send a hard coded login/password and issue several
other hard coded commands just to get to the part where actual data is
requested. This process up until having data requested takes about 8
seconds.

I'd like to eliminate those 8 seconds by having a cache of NIO
SocketChannel Objects, whom have already done the setup up until data
is ready to be requested.

I'm thinking of having an ObjectPool to do this, refreshing the
pre-prepared SocketChannel objects every few minutes. The socket
connection is stable, able to request data without any activity after
ten minutes, during my tests.

Any ideas? Anyone know of a similair problem/solution? Code or links
would be helpful.
iksrazal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top