Random “An existing connection was forcibly closed by the remote host.” after a TCP reset

后端 未结 4 2106
你的背包
你的背包 2021-02-19 19:14

I have two parts, a client and a server. And I try to send data (size > 5840 Bytes) from the client to the server and then the server sends the data back. I loop this a number o

4条回答
  •  没有蜡笔的小新
    2021-02-19 19:23

    We had this problem when using HttpClient random errors like

    System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
     ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
     ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
    

    or

     ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send.
    

    Problem in Explicit Congestion Notification, or ECN, in the TCP stack. This is also known as ECN Capability. Explicit Congestion Notification is an extension to the Internet Protocol and to the Transmission Control Protocol and is defined in RFC 3168. ECN allows end-to-end notification of network congestion without dropping packets. If ECN Capability is enabled, you can disable it:

    netsh interface tcp set global ecncapability=disabled
    

    A reboot is not required.

提交回复
热议问题