| Author |
Unexpected SocketTimeoutException
|
Sun LiWei
Ranch Hand
Joined: Aug 10, 2002
Posts: 49
|
|
I have a thread which using DatagramSocket in the run() method: MyThread extends Thread{ public void run(){ try{ DatagramSocket socket=new DatagramSocket(); socket.send(...); socket.recieve(...); socket.close(); }catch(Exception e){ e.printStackTrace(); } } } When I generate tens of threads with MyThread, most of the threads run without exception,but there're always some threads throw a SocketTimeoutException,the network is ok though,when i run one thread a time,no exception! I can't figure it out.Help me.
|
 |
 |
|
|
subject: Unexpected SocketTimeoutException
|
|
|