I am trying to read the UDP packages in python, which were sent from an FPGA. I see the packages in wireshark, and they look allright. Python, h开发者_C百科owever does not receive anything when I use this simple script:
import socket
import sys
HOST, PORT = "192.168.1.1", 21844
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.connect((HOST,PORT))
received = sock.recv(1024)
You don't connect
with a UDP server (I assume the Python code is the server), you bind
.
精彩评论