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
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