0
当我运行代码:OSERROR:[WinError 10049]请求的地址不在其上下文中有效
name = socket.gethostname()
#ip = socket.gethostbyname(name)
port = 5000
ip = "90.95.52.220"
print("Ip server: %s"%ip)
s.bind((ip, port)
我得到这个错误:
"OSError: [WinError 10049] The requested address is not valid in its context"
如果我得到的IP使用socket.gethostbyname(名称)它给了我一个IP,但通过使用该IP,其他人无法连接到我的服务器。我能做什么?我在类似的问题上阅读答案,但他们都没有工作。