简体   繁体   English

Socket.bind()在Win7上返回“请求的地址在其上下文中无效。”

[英]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. 看起来您正在传递本地和远程地址。

Edit: 编辑:

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.

相关问题 获取请求的地址在其上下文中无效。 在我的聊天应用程序中 - Getting The requested address is not valid in its context. in my chat application 套接字错误请求的地址在其上下文中无效 - Socket Error The requested address is not valid in its context “请求的地址在其上下文中无效” SocketException - “The requested address is not valid in its context” SocketException WCF Tcp绑定“请求的地址在其上下文中无效”错误 - WCF Tcp Binding “The requested address is not valid in its context” Error 当我尝试侦听端口时,请求的地址在其上下文中无效 - The requested address is not valid in its context when I try to listen a port SocketException:请求的地址在上下文中无效 - SocketException: The requested address is not valid in the context HttpListener:请求的地址在此上下文中无效 - HttpListener: The requested address is not valid in this context 为什么我的服务器 TcpListener 使用本地地址而不使用公共地址? - 例外:请求的地址在其上下文中无效 - Why is my Server TcpListener Working with Local Address but not with Public Address? - Exception: The requested address is not valid in its context Socket.Bind()引发“无效参数”异常 - Socket.Bind() throws “Invalid parameters” exception Mono-缺少Socket.Bind等方法 - Mono - missing Socket.Bind and other methods
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM