Multithreading with Socket Connection

I have a code which actually runs some number of predefined threads (More than 1).

The fucntionality of the thread code is to connect to another system through Socket Connections (using IP and port) and send a request to it and get back the response from that sys through DataStreams.

While executing this program, for example if i ahve some 10 threads running, 4 of them succeed in connecting the next system and getting back the response from it. Remaining 6 of them fail due to different Socket exceptions. They are:

java.net.SocketException: Connection reset

java.net.SocketException: Socket closed

Exception writing to socket:

But if the same program i run with single thread, it works fine as expected.

Please help me with this - Thanks in advance.

[805 byte] By [tech_b_ka] at [2007-11-27 9:40:26]
# 1
It seems to be the servere design/impl issue.
hiwaa at 2007-7-12 23:17:35 > top of Java-index,Core,Core APIs...