Jun-21-2021, 06:32 AM
Looks okay to me. I wonder if you have some strange networking going on. Unprompted UDP like this shouldn't be subject to NAT, but I have no other explanation. It works fine on my machine. The only change I made was to bind to all addresses so I didn't have to hardcode my IP.
... if __name__ == '__main__': UDP_IP = "0.0.0.0" UDP_PORT = 5005 ...Client:
Output:$ ip -br addr show dev eth0 scope global
eth0 UP 10.0.0.10/24
$ echo -n "Test UDP message" > /dev/udp/10.0.0.209/5005
$
Server:Output:From: ('10.0.0.10', 58743) received message: b'Test UDP message'