无法从传输连接读取数据,远程主机强行关闭现有连接 [英] unable to read data from the transport connection an existing connection was forcibly closed by remote host

查看:245
本文介绍了无法从传输连接读取数据,远程主机强行关闭现有连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我收到一个奇怪的错误,我正在创建一个winform应用程序,扫描仪正在扫描图像并将其上传到远程服务器,这是工作文件无处不在,但我们在南非也有客户端,它不在那里工作,而在ulpoading图像它给我错误。



Hi All,

I am getting a weird error ,I am creating a winform application in which scanner is scanning an image and uploading it to the remote server, this is working file everywhere ,but we have client in south africa also ,its not working there and while ulpoading image it is giving me error.

unable to read data from the transport connection an existing connection was forcibly closed by remote host





FYI,图像以KB为单位创建,因此没有关于图像大小的问题。



请建议。



FYI ,Image is creating in KBs so no issue regarding size of image.

Please suggest.

推荐答案

上面的问题已经解决,是由于代理服务器发生的,所以我用简单的单行代码绕过了代理服务器。



The above problem is solved ,is was occurring due to proxy server ,so I bypassed the proxy server by simple single line code .

System.Net.ServicePointManager.Expect100Continue = false;





就在服务被调用之前。



just before the service is called.


你的代码与此无关。



基本上远程端已终止套接字。 强行只是意味着它是以一种不寻常的方式完成的,但它仍然是远程端。



如果是我,我会从防火墙开始。防火墙可以设置为强制关闭套接字,如果它不符合防火墙规则的标准 - 通常是一个时间限制。我在那里使用强制,因为这样的闭包会给你准确的错误。



您可以计算连接在错误发生之前持续多长时间。例如,如果是,那么每次几乎都说5分钟而且从不长(超过一对)然后,这将强烈表明网络基础设施中的某些东西正在关闭它。
Your code has nothing to do with this.

Basically the remote end has terminated the socket. The 'forcibly" just means it was done in an unusual way but it is still the remote end.

If it was me I would start by looking at firewalls. Firewalls can be set to "forcibly" close a socket if it does not meet the criteria of the firewall rule - usually a time limit. And I use "forcibly" specifically there because such a closure would give you exactly the error you are seeing.

You might time how long the connection lasts before the error occurs. If it is, for example, say almost exactly 5 minutes every time and never longer (more than a couple of seconds) then that would be a strong indication that something in the network infrastructure is closing it.


这篇关于无法从传输连接读取数据,远程主机强行关闭现有连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆