5

I have a client-server application. In the client side(I have no access to client code), a socket exception occurs intermittently that says "java.net.SocketException: Connection reset". It's not "java.net.SocketException: Connection reset by peer". With this information, can I conclude that the issue is with Client side?

Raedwald
  • 46,613
  • 43
  • 151
  • 237
object
  • 796
  • 1
  • 12
  • 21

1 Answers1

4

Usually "Connection reset" means that both sides did an orderly close of the connection, and then you attempted to work on that socket. The reason for the orderly shutdown could have been initiated by either side. So I'd say that you can't determine which side based on this error.

"Connection Reset by Peer" means the remote end would have sent a reset packet (RST) to kill the connection without an orderly shutdown (close). In that case you know it was the peer(client).

Michael Petch
  • 46,082
  • 8
  • 107
  • 198
  • In my case the remote end is sending a RST packet and my local Java application throws "SocketException: Connection reset" – golimar Oct 14 '21 at 09:56