我有正确的密码。一切似乎都还好,但是它没有捕获任何数据包:
UDP_PORT = 0
sock = socket.socket(socket.AF_INET, # Internet
socket.SOCK_DGRAM ) # UDP
sock.bind(('', 0))
print("waiting on port:", UDP_PORT)
while True:
data, addr = sock.recvfrom(65565) # buffer size is 1024 bytes
print ("received message:", data)