用于从 FPGA 接收 UDP 包的 Python 套接字
我正在尝试用 python 读取 UDP 包,这些包是从 FPGA 发送的。我在wireshark中看到了这些包,它们看起来不错。然而,当我使用这个简单的脚本时,Python 不会收到任何内容:
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)
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, however 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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不
连接
与UDP服务器(我假设Python代码是服务器),您绑定
。You don't
connect
with a UDP server (I assume the Python code is the server), youbind
.