OSError: [Errno 22] Invalid argument?
OSError: [Errno 22] Invalid argument?
我保证如果你能在 20 分钟内解决这个问题,我会给你 100 声望...我的情况非常紧急。
我运行这个命令:python3 ringo.py F 6003 networklab1.cc.gatech.edu 6002 2
poc_address = (poc_name, int(poc_port))
peer_data = json.dumps({
'command': 'peer_discovery',
'peers': peers,
'ttl': 6,
})
print(poc_address) # ('130.207.107.12', 6002)
server.socket.sendto(
peer_data.encode('utf-8'),
poc_address <--- error here..!!
)
130.207.107.12
我收到这个错误:OSError: [Errno 22] Invalid argument
在 poc_address
Serversocket 定义较早
server = socketserver.UDPServer((HOST, PORT), MyUDPHandler)
server_thread = Thread(target=server.serve_forever, args=())
server_thread.daemon = False
server_thread.start()
HOST, PORT = socket.gethostbyname(socket.gethostname()),
而不是 127.0.0.1
解决了我的问题。 :)
我保证如果你能在 20 分钟内解决这个问题,我会给你 100 声望...我的情况非常紧急。
我运行这个命令:python3 ringo.py F 6003 networklab1.cc.gatech.edu 6002 2
poc_address = (poc_name, int(poc_port))
peer_data = json.dumps({
'command': 'peer_discovery',
'peers': peers,
'ttl': 6,
})
print(poc_address) # ('130.207.107.12', 6002)
server.socket.sendto(
peer_data.encode('utf-8'),
poc_address <--- error here..!!
)
130.207.107.12
我收到这个错误:OSError: [Errno 22] Invalid argument
在 poc_address
Serversocket 定义较早
server = socketserver.UDPServer((HOST, PORT), MyUDPHandler) server_thread = Thread(target=server.serve_forever, args=()) server_thread.daemon = False server_thread.start()
HOST, PORT = socket.gethostbyname(socket.gethostname()),
而不是 127.0.0.1
解决了我的问题。 :)