When a peer resets a connection the Socket.getInputStream().read()
method will correctly throw a SocketException indicating that the
connection has been reset. However the behaviour of subsequent reads
is platform specific.
On Windows all subsequent reads will throw a SocketException but
on Solaris and Linux we will return -1 (eof) or even some data and
no exception is thrown.
Additionally the behaviour of available() differs. On Solaris/Linux
if available() is called then the connection is reset it will
throw a SocketException and subsequent calls to available() will
return >= 0. On Windows the available() will return 0 and no
exception is thrown.
- relates to
-
JDK-4665002 (so) SocketChannel.read should behave consistently after reset
-
- Closed
-
-
JDK-4524090 SSLSocketImpl error behavior inconsistent with java.net.Socket
-
- Closed
-