dcsimg
Plain Socket pool and reuse--HELP ASAP
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Raj_K
Posted On:   Wednesday, April 17, 2002 06:51 AM

Hi I am trying to create a pool of sockets(at the client) and reuse them without having to recreate everytime so as to reduce the IO. But I have problems re-using the sockets. The first read and recv are fine but when I re-use the socket, a null-pointer is thrown while invoking getOutputStream() on the socket object(though the socket does not qualify for null condition). I am zapped. After every read and recv, I am closing the streams. Please let me know if there is something that I am missing here. If reqd I can paste the code here. Why can't I do this when a connection pool can be implemented for the database and other servers which is again socket connection at the base level? Can you help ASAP.Thanks. KR    More>>

Hi
I am trying to create a pool of sockets(at the client) and reuse them without having to recreate everytime so as to reduce the IO. But I have problems re-using the sockets. The first read and recv are fine but when I re-use the socket, a null-pointer is thrown while invoking getOutputStream() on the socket object(though the socket does not qualify for null condition). I am zapped. After every read and recv, I am closing the streams.
Please let me know if there is something that I am missing here. If reqd I can paste the code here.

Why can't I do this when a connection pool can be implemented for the database and other servers which is again socket connection at the base level?

Can you help ASAP.Thanks.

KR

   <<Less
About | Sitemap | Contact