-->

连接尝试失败,因为连接的方没有正确一段时间后响应或连接的主机没有反应(A connection at

2019-09-23 14:58发布

我正在开发一个Windows服务,从特定的URL下载图像。 该服务正常运行我的电脑上,但是当我在服务器中安装它,它不下载图像,并提供了以下错误:

System.Net.WebException:无法连接到远程服务器---> System.Net.Sockets.SocketException:A连接尝试失败,因为连接的方没有正确一段时间后响应或已建立的连接失败,因为连接的主机没有反应212.100.220.117:80

在System.Net.Sockets.Socket.DoConnect(端点endPointSnapshot,为SocketAddress的SocketAddress)

在System.Net.ServicePoint.ConnectSocketInternal(布尔connectFailure,插座s4中,插座S6中,插座和插座,ip地址和地址,ConnectSocketState状态,IAsyncResult的asyncResult,的Int32超时,异常&除外)

---内部异常堆栈跟踪的结尾---

在System.Net.WebClient.DownloadDataInternal在System.Net.WebClient.DownloadData在System.Net.WebClient.DownloadData(URI地址,的WebRequest&请求)(URI地址)(字符串地址)

什么可能导致的错误,如何解决? 我阅读此页: http://support.microsoft.com/kb/318140

但我不知道这是一个问题,如果它是什么代理,我应该在配置写。 询问你的建议。

谢谢,

Answer 1:

我找到了答案。 我试图访问公共地址“ http://mywebsite.com/images/从服务器”。 取而代之的是我使用的服务器的本地IP主办的网站,它现在的工作。



文章来源: A connection attempt failed because the connected party did not properly respond after a period of time or connected host has failed to respond