Socket.bind()返回"请求的地址不在其上下文中有效&QUOT。 Win7上 [英] Socket.bind() returns "The requested address is not valid in its context." on Win7

查看:290
本文介绍了Socket.bind()返回"请求的地址不在其上下文中有效&QUOT。 Win7上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用Socket.bind()函数是这样的:

I am trying to use the Socket.bind() function this way:

Bind(new IPEndPoint(myInternalAddress, myPort));



我得到的错误是请求的地址是无效的上下文。,但这只发生在Windows 7(我用64位)。

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).

Befor我升级前几天这是工作的罚款,我检查了IP地址是正确的人

Befor my upgrade a few days ago this was working fine, and I checked the IPs to be the correct ones.

任何帮助将上究竟是什么出了问题在这里欣赏。

Any help would be appreciated on what exactly goes wrong here.

推荐答案

绑定() ...套接字绑定到本地的 IP地址端口。这就是 IPEndPoint 需要在其构造函数(见的 IPEndPoint(地址,端口) )。 。看起来你逝去的本地和远程地址了,而不是

bind() ... binds a socket to local IP address and port. That's what IPEndPoint takes in its constructor (see IPEndPoint(address, port)). Looks like you are passing local and remote addresses there instead.

如果没有端口工作那么它可能是错误的IP地址。既然你提到了升级 - 看看有什么变化 - 是地址仍然是相同的? IPCONFIG - 提示,提示

If none of the ports work then it's probably the IP address that is wrong. Since you mention an "upgrade" - see what changed - is the address still the same? ipconfig - hint, hint.

这篇关于Socket.bind()返回"请求的地址不在其上下文中有效&QUOT。 Win7上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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