Parsing the string message seems bad. Or was this exception not meant to be caught?
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21)
io. IOException: Connection reset by peer are given below. If the other side has abruptly aborted the connection in the middle of a transaction that is not controllable from the server-side. If the end-user decides to shutdown the client or changes the server abruptly when that server interacts with your server.
Connection Reset by peer means the remote side is terminating the session. This error is generated when the OS receives notification of TCP Reset (RST) from the remote server.
In order to fix it, you would want to see the stack trace of your exception or at least the message, to see exactly where the exception is thrown and why. try { methodThrowingIOException(); } catch (IOException e) { System. out. println(e.
The error message "Connection reset by peer" appears, if the web services client was waiting for a SOAP response from the remote web services provider and the connection was closed prematurely. One of the most common causes for this error is a firewall in the middle closing the connection.
You need to catch the IOException
and, yes, parse the string.
There isn't any other exception more specific than that to be caught as far as I know.
Or catch SocketException
and, again, parse the string.
Here's the class tree from javadoc (version 6). As you can see, SocketException
is the most specialized exception to be thrown when the connection is reset.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With