Exception in thread "main" java.net.SocketException: Connection reset

错误:

Exception in thread "main" java.net.SocketException: Connection reset

at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)

at java.io.FilterInputStream.read(Unknown Source)


原因:

当客户端缺少flush语句。。。

out.flush(); 


还有,用BufferedWriter流一定要记得写入之后flush一下。。不然没有东西的。。。

你可能感兴趣的:(Exception in thread "main" java.net.SocketException: Connection reset)