HttpClient Connection reset by peer: socket write error

前端 未结 1 1831
清酒与你
清酒与你 2020-12-21 19:15

I used httpclient 4.4 to send get and post request. and i just created a simpile wrapper of httpclient for easy use:


    package com.u8.server.sdk;

    import c         


        
相关标签:
1条回答
  • 2020-12-21 20:00

    The peer of your client is the server. So "Connection reset by peer" means the server reset the socket. Reset means forceably closed.

    This might be because of a bug in the server. If you also wrote the server or servlet (as will be the case for a custom protocol), you need to examine the behaviour of the server to examine the cause of this. The log files of the server might provide clues.

    If the server has protection against bisbehaving or malicious clients, the server might have reset the socket because it has classified your client as misbehaving. If you implemented the client protocol code it might be because of a bug in your protocol implementation. If you are using third party code for handling the communication protocol you might still be misusing it; for example by sending excessively large requests. It is not uncommon for HTTP servers to protect themselves against denial of service attacks by imposing maximum lengths for header fields and bodies, and to require that clients send data at a reasonably fast rate (without pausing for long periods). Your client might have fallen foul of these protections.

    0 讨论(0)
提交回复
热议问题