Michael
Michael

Reputation: 103

Python socket for receiving UDP packages from an FPGA

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)

Upvotes: 1

Views: 777

Answers (1)

Marcelo Cantos
Marcelo Cantos

Reputation: 186118

You don't connect with a UDP server (I assume the Python code is the server), you bind.

Upvotes: 1

Related Questions