[英]Socket.bind() returns “The requested address is not valid in its context.” on Win7
I am trying to use the Socket.bind() function this way: 我试图以这种方式使用Socket.bind()函数:
Bind(new IPEndPoint(myInternalAddress, myPort));
The error I am getting is "The requested address is not valid in its context.", but this only happens on Windows 7 (I am using 64 bit). 我收到的错误是“请求的地址在其上下文中无效。”,但这仅在Windows 7上发生(我使用的是64位)。
Befor my upgrade a few days ago this was working fine, and I checked the IPs to be the correct ones. 在几天前进行升级之前,这工作正常,我检查了IP是否正确。
Any help would be appreciated on what exactly goes wrong here. 任何帮助将不胜感激在这里到底出了什么问题。
bind()
... binds a socket to local IP address and port . bind()
...将套接字绑定到本地IP地址和端口 。 That's what IPEndPoint
takes in its constructor (see IPEndPoint(address, port)
). 这就是
IPEndPoint
接受其构造函数的方式(请参阅IPEndPoint(address, port)
)。 Looks like you are passing local and remote addresses there instead. 看起来您正在传递本地和远程地址。
If none of the ports work then it's probably the IP address that is wrong. 如果所有端口都不起作用,则可能是IP地址错误。 Since you mention an "upgrade" - see what changed - is the address still the same?
由于您提到了“升级”-看看有什么变化-地址仍然不变吗?
ipconfig
- hint, hint. ipconfig
提示,提示。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.