StackOverflow

https://stackoverflow.com/questions/5420656/unable-to-read-data-from-the-transport-connection-an-existing-connection-was-f

https://briancaos.wordpress.com/2012/07/06/unable-to-read-data-from-the-transport-connection-the-connection-was-closed/

https://briancaos.wordpress.com/2012/06/15/an-existing-connection-was-forcibly-closed-by-the-remote-host/

https://docs.microsoft.com/en-us/iis/configuration/system.webserver/httpprotocol/

按照上面的链接的说明,尝试修改了一下keepalive,就可以了。改为false

<configuration>
<system.webServer>
<httpProtocol allowKeepAlive="false" />
</system.webServer>
</configuration>

https://docs.microsoft.com/en-us/iis/configuration/system.applicationhost/sites/site/limits

<system.applicationHost>
<sites>
<siteDefaults>
<limits connectionTimeout="00:02:00" />
</siteDefaults>
</sites>
</system.applicationHost>

https://docs.microsoft.com/en-us/iis/configuration/system.webserver/security/requestfiltering/requestlimits/index

<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>

Optional uint attribute.

Specifies the maximum length of content in a request, in bytes.

The default value is 30000000, which is approximately 28.6MB.

keepalive

使用wireshark抓包

https://support.quest.com/appassure/kb/118165

Here are a few items that may indicate a networking issue:

TCP Dup ACK (tcp.analysis.duplicate_ack)

https://ask.wireshark.org/questions/39043/1500-duplicate-acks-before-retransmission

Looks like classic buffer bloating to me. The problem appears when you send large amounts of data from a high speed network to a lesser speed network real fast, causing the switch or router buffers to fill up. At that point, packet loss will occur, and the receiver will send duplicate ACKs to notify the sender of the missing segment(s).

The problem is: since the full buffer is still constantly slammed with more packets the retransmission can't get through fast but has to "get in line" like all the other packets, which means that it takes a long time to get to the receiver. That's the reason why you see very high numbers of duplicate ACKs for the same missing segment.

The only thing you can do is to have the receiver advertise a smaller receive window, to prevent overloading the network.

A packet is duplicated somewhere on the network and received twice at the receiving host.

It is very often not desireable to get these duplicates, as the receiving application might think that's "fresh" data (which it isn't).

If a sending host thinks a packet is not transmitted correctly because of a PacketLoss, it might Retransmit that packet.

The receiving host might already got the first packet, and will receive a second one, which is a duplicated packet.

  • If the Duplicate ACK count is very low (Ex: TCP Dup ACK #1), this may indicate an Out-of-Order packet.
  • If the Duplicate ACK count is high, this typically indicates packet loss.

TCP Out-of-order packets (tcp.analysis.out_of_order)

Indicate that the packet was received out of sequence.

This means that the packet will be held in the buffer of the receiver until the proper packets to complete the sequence are received.

Once received then the sequence can be committed.

The more out of order packets that occur the more likely the buffer will fill up.

When the buffer is full, the receiver will then start dropping the out of order packets.

When it does that it will have to start requesting retransmission of those packets.

This process increases the chances for timeouts of the data streams and failures of replication.

TCP retransmissions (tcp.analysis.retransmission)

Indicate that there is a packet that is incomplete, out of order, corrupt, timed out or lost.

When seen with many TCP Out-of-order packets it can indicate that the problem is being caused by the flow of the packets and the fact that they are not coming through in sequence.

TCP Spurious retransmissions (tcp.analysis.spurious_retransmission)

TLS Version

https://stackoverflow.com/questions/2582036/an-existing-connection-was-forcibly-closed-by-the-remote-host

https://stackoverflow.com/questions/2582036/an-existing-connection-was-forcibly-closed-by-the-remote-host

https://blogs.perficient.com/microsoft/2016/04/tsl-1-2-and-net-support/

https://docs.microsoft.com/en-us/dotnet/api/system.net.servicepointmanager?view=netframework-4.7

Example

.net remoting中遇到的问题

Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.

Server stack trace:
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Runtime.Remoting.Channels.ChunkedMemoryStream.WriteTo(Stream stream)
at System.Runtime.Remoting.Channels.Http.HttpClientTransportSink.ProcessAndSend(IMessage msg, ITransportHeaders headers, Stream inputStream)
at System.Runtime.Remoting.Channels.Http.HttpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at LISA.ControlPanelBLL.Entities.IProgramManager.UpdateTransactionGroup(Int32 userid, String connString, TransactionGroup transactionGroup, String& _message)
at LISA.ControlPanelBLL.TransactionGroup.UpdateRow()
at LISA.ControlPanel.UserControls.Transaction.TransactionGroupListControl.btnWorkflow_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

https://stackoverflow.com/questions/2582036/an-existing-connection-was-forcibly-closed-by-the-remote-host

This generally means that the remote side closed the connection (usually by sending a TCP/IP RST packet). If you're working with a third-party application, the likely causes are:

  • You are sending malformed data to the application
  • The network link between the client and server is going down for some reason
  • You have triggered a bug in the third-party application that caused it to crash
  • The third-party application has exhausted system resources

It's likely that the first case is what's happening.

You can fire up Wireshark to see exactly what is happening on the wire to narrow down the problem.

Without more specific information, it's unlikely that anyone here can really help you much.

使用wireshark抓取到两次RST

An existing connection was forcibly closed by the remote host的更多相关文章

  1. Database mirroring connection error 4 'An error occurred while receiving data: '10054(An existing connection was forcibly closed by the remote host.)

    公司一SQL Server镜像发生了故障转移(主备切换),检查SQL Server镜像发生主备切换的原因,在错误日志中发现下面错误: Date        2019/8/31 14:09:17   ...

  2. ssh问题:ssh_exchange_identification: Connection closed by remote host

    ssh问题:ssh_exchange_identification: Connection closed by remote host... 刚刚一个朋友告诉我SSH连接不上服务器了,重启电脑也不管用 ...

  3. By default, the connection will be closed if the proxied server does not transmit any data within 60 seconds.

    WebSocket proxying https://nginx.org/en/docs/http/websocket.html By default, the connection will be ...

  4. 【Ansible】SSH Error: ssh_exchange_identification: Connection closed by remote host

    ansible ssh到目标机器 时好时坏,报错:  SSH Error: ssh_exchange_identification: Connection closed by remote host ...

  5. 单元测试报connection is allready closed导致dailybuild中断的解决方案——类加载机制的应用

    现象; 前段时间在dailybuild过程中,经常遇到connection is allready closed错误,特别是在dailybuild高峰期. 分析定位: 这个错误是的起因比较多,这里的情 ...

  6. sftp修改用户home目录后登录时报connection closed by remote host

    在sftp用户需要修改登录根目录的情况下,我们可以修改/etc/ssh/sshd_config文件中ChrootDirectory /home/[path]的路径. 但是,在重启sshd服务后,sft ...

  7. ssh_exchange_identification: Connection closed by remote host

    用服务器内网ip连接同子网服务器的时候显示ssh_exchange_identification: Connection closed by remote host 防火墙什么都关闭了,还是显示这个问 ...

  8. Bind 远程连接DNS服务器时出现 rndc: connection to remote host closed

    使用命令:rndc -s 192.168.1.2 status 连接远程的bind 搭建的DNS服务器时出现下面的错误:   rndc: connection to remote host close ...

  9. xshell连接不了虚拟机处理方法(错误提示:Connection closing...Socket close.Connection closed by foreign host.Disconnected from remote host(localhost) at 08:47:23.)

    一.问题描述:xshell连接不了虚拟机,出现错误提示:Connection closing...Socket close.Connection closed by foreign host.Disc ...

随机推荐

  1. static方法调用

    Static方法调用,类名.方法名 int number = Integer.ParseInt(String ); 将字符串参数作为有符号的十进制整数进行解析 将数字解析成字节数组 Character ...

  2. Struts2中的异步提交(ajaxfileupload异步上传(图片)插件的使用)

    server端採用struts2来处理文件上传. 所需环境: jquery.js ajaxfileupload.js struts2所依赖的jar包 及struts2-json-plugin-2.1. ...

  3. nyoj--1023--还是回文(动态规划)

    还是回文 时间限制:2000 ms  |           内存限制:65535 KB 难度:3 描述 判断回文串很简单,把字符串变成回文串也不难.现在我们增加点难度,给出一串字符(全部是小写字母) ...

  4. Pandas与Matplotlib

    Pandas与Matplotlib基础 pandas是Python中开源的,高性能的用于数据分析的库.其中包含了很多可用的数据结构及功能,各种结构支持相互转换,并且支持读取.保存数据.结合matplo ...

  5. [jzoj NOIP2018模拟11.02]

    嗯T1忘记取模了,100到20 嗯T2忘记了那啥定理,暴力也写炸了,这题我认 嗯T3线段树合并分裂没有写炸,考场上就知道妥妥的70分.但是,分数出的时候听到有人说暴力也是70分,我???脸黑,枉我敲了 ...

  6. sublime配置python运行环境

    1.sublime下载与插件管理 1.1 下载 官网地址:https://www.sublimetext.com/3 1.2 安装Package Control管理插件 使用ctrl + ` (感叹后 ...

  7. JS的数据类型(包含:7种数据类型的介绍、数据类型的转换、数据类型的判断)

    前言 最新的 ECMAScript 标准定义了JS的 7 种数据类型,其中包括: 6 种基本类型:Boolean.Null.Undefined.Number.String.Symbol (ECMASc ...

  8. hiho 1620 - 股票价格3 - 无限制的单调队列?

    题目链接 小Hi最近在关注股票,为了计算股票可能的盈利,他获取了一只股票最近N天的价格A1~AN. 小Hi想知道,对于第i天的股票价格Ai,几天之后股价会第一次超过Ai. 假设A=[69, 73, 6 ...

  9. hdu 2037 - 典型贪心*

    题目链接 给一堆电视节目的起止时间,问最多能完整收看几个节目 --------------------------------------------------------------------- ...

  10. QT笔记 -- (4) 为QLabel添加鼠标响应方法2

    1.实现 bool eventFilter(QObject *target,QEvent *event) 函数内容如下: bool eventFilter(QObject *target,QEvent ...