In the image, the specs of the UDP package I aim to capture is shown through WireShark. The UDP packet comes from a different client attached to my router. However, when trying to capture this using socket through python, I keep on getting OSError: [Errno 99] Cannot assign requested address.
Currently I am doing following:
import sys
import socket
##Capture UDP packets
UDP_IP = "192.168.13.13"
UDP_PORT = 1667
# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Bind the socket to the port
server_address = (UDP_IP, UDP_PORT)
print(sys.stderr, 'starting up on %s port %s' % server_address)
sock.bind(server_address)
while True:
print (sys.stderr, '\nwaiting to receive message')
data, address = sock.recvfrom(4096)
print (sys.stderr, 'received %s bytes from %s' % (len(data), address))
print (sys.stderr, data)
Is this the correct address to use?