java.net.SocketException: Connection reset

前端 未结 10 1514
慢半拍i
慢半拍i 2020-11-22 03:02

I am getting the following error trying to read from a socket. I\'m doing a readInt() on that InputStream, and I am getting this error. Perusing th

10条回答
  •  一个人的身影
    2020-11-22 03:50

    There are several possible causes.

    1. The other end has deliberately reset the connection, in a way which I will not document here. It is rare, and generally incorrect, for application software to do this, but it is not unknown for commercial software.

    2. More commonly, it is caused by writing to a connection that the other end has already closed normally. In other words an application protocol error.

    3. It can also be caused by closing a socket when there is unread data in the socket receive buffer.

    4. In Windows, 'software caused connection abort', which is not the same as 'connection reset', is caused by network problems sending from your end. There's a Microsoft knowledge base article about this.

提交回复
热议问题