This is really tough.. So the exception is thrown in only one place, look at line 168] of java.net.SocketInputStream.read (byte [, int, int) to which this community from the normal read (called).
Code:
if (impl.isConnectionReset ()) (
throw new SocketException ("Connection reset");
)
The impl is implemented in connection java.net.PlainSocketImpl the State CONNECTION_RESET once set in the available method. Unfortunately, the socketAvailble () method is again that is more purely native debug that may not possible.
Code:
int n = 0;
try (
n = socketAvailable ();
if (n == 0 & & isConnectionResetPending ()) (
setConnectionReset ();
)
) Catch (Exception exc1 Connection reset) (
setConnectionResetPending ();
try (
n = socketAvailable ();
if (n == 0) (
setConnectionReset ();
)
) Catch (Exception exc2 Connection reset) (
)
)
Bookmarks