My socket is closed when the reader/writer are closed... (using concurrnet)

hi all

I am using the concurrent package for JRE 1.4

My runnable is using a Thread Local socket which is opened for the first runnable that reaches each pooled thread.

I declare the BufferedWriter and BufferedReader at the runnable level

The strange thing is that when I close at the end of the execution of the runnable the BufferedWriter / BufferedReader the next time that I try to connect to the Socket (in the new runnable that uses the same pooled thread) its alreayd closed...

If i dont close them the socket remains open...

Thanks for your help !!

[598 byte] By [kluberga] at [2007-11-26 19:16:26]
# 1
What do you mean by 'the next time that I try to connect to the Socket'?Closing a socket's input stream or output stream closes the output or input stream and the socket.
ejpa at 2007-7-9 21:29:29 > top of Java-index,Core,Core APIs...
# 2
I just read about it in the net... i am a socket beginner...so if i want to use the sockets lots of times... should i declare only one reader and writer and reuse them ?Thanks a lot :-)
kluberga at 2007-7-9 21:29:29 > top of Java-index,Core,Core APIs...
# 3
yes
ejpa at 2007-7-9 21:29:29 > top of Java-index,Core,Core APIs...
# 4
thanks a lot dear ejp
kluberga at 2007-7-9 21:29:29 > top of Java-index,Core,Core APIs...