阅读背景:

“java.net.BindException:“已在使用的地址”,当尝试与以前使用的相同套接字创建相同的套接字时

来源:互联网 

I'm working on Client-Server simulation in Java where Clients (threads) are connecting to server to get some data. After several seconds, one of randomly chosen client (thread) needs to be killed. I close socket it used for communication to server and left him die (by exiting from run() method). Problem is when new created thread is trying to create same socket as previous one used (same addresses and same ports) to connect to server, I'm getting: I'm working on Client-Server simulation in Java




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: