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

HOST, PORT = socket.gethostbyname(socket.gethostname()), 而不是 127.0.0.1 解决了我的问题。 :)