.net 试图对无法访问的主机进行套接字操作
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5164466/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
A socket operation was attempted to an unreachable host
提问by Adrya
One customer reported this error at my WCF client connecting to our server service.
一位客户在我的 WCF 客户端连接到我们的服务器服务时报告了此错误。
"Message: A socket operation was attempted to an unreachable host Type : System.Net.Sockets.SocketException"
“消息:试图对无法访问的主机类型进行套接字操作:System.Net.Sockets.SocketException”
From this link http://msdn.microsoft.com/en-us/library/ms740668%28v=vs.85%29.aspxi see:
从这个链接http://msdn.microsoft.com/en-us/library/ms740668%28v=vs.85%29.aspx我看到:
WSAEHOSTUNREACH 10065 No route to host. A socket operation was attempted to an unreachable host. See WSAENETUNREACH.
WSAEHOSTUNREACH 10065 没有到主机的路由。试图对无法访问的主机执行套接字操作。请参阅 WSAENETUNREACH。
WSAENETUNREACH 10051 Network is unreachable. A socket operation was attempted to an unreachable network. This usually means the local software knows no route to reach the remote host.
WSAENETUNREACH 10051 网络不可达。试图对无法访问的网络执行套接字操作。这通常意味着本地软件不知道到达远程主机的路径。
Is this a network error on customer network? Is it something we can advise customer to do?
这是客户网络上的网络错误吗?我们可以建议客户做些什么吗?
WCF Client was able to connect to the server service before and seems that problem disappeared after reboot of machine (or maybe network problem was fixed in the meantime).
WCF 客户端之前能够连接到服务器服务,并且似乎在机器重新启动后问题消失了(或者网络问题在此期间已修复)。
Thank you
谢谢
Adriana
阿德里亚娜
采纳答案by Stephen Cleary
This error indicates that the network was not connected or not configured correctly. It is definitely an error on the client machine, not your server.
此错误表示网络未连接或配置不正确。这绝对是客户端机器上的错误,而不是您的服务器。
There isn't much you can do to "solve" the problem. Pretty much all you can do is upgrade the client's network drivers and check for connection problems (maybe they're barely within wireless range, or the Ethernet cable is missing its locking tab).
要“解决”问题,您无能为力。您几乎可以做的就是升级客户端的网络驱动程序并检查连接问题(也许它们几乎不在无线范围内,或者以太网电缆缺少其锁定选项卡)。
回答by Peon the Great
You can help your customers or FAEs to develop an SOP for identifying connectivity issues. Say, pinging the server IP from client machine, do an ipconfig and see if the machine's network adapter is up or not.
您可以帮助您的客户或 FAE 制定用于识别连接问题的 SOP。比如说,从客户端机器 ping 服务器 IP,执行 ipconfig 并查看机器的网络适配器是否已启动。
回答by srbh
This problem is because the same port number is accessed by one more node in web config. Change it . Happy Coding.
这个问题是因为 web config 中的另一个节点访问了相同的端口号。更改 。快乐编码。

