java.net.SocketException: Connection reset by peer: socket write error

java.net.SocketException: Connection reset by peer: socket write error
 at java.net.SocketOutputStream.socketWrite0(Native Method)
 at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:105)
 at java.net.SocketOutputStream.write(SocketOutputStream.java:149)
 at java.io.DataOutputStream.write(DataOutputStream.java:115)
 at java.io.DataOutputStream.writeUTF(DataOutputStream.java:412)
 at java.io.DataOutputStream.writeUTF(DataOutputStream.java:334)
 at socket.Client.initClient(Client.java:31)
 at socket.Client.main(Client.java:14)

 

原因是:客户端发送数据到服务器的时候,服务器没做相应的回复,导至超时发送的问题,把服务器的socket监听进行循环读取就可以了

你可能感兴趣的:(Connection,reset,by,peer:,socket,write,error)