I have a simple UDP server implemented in python:
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(("",10005))
while True:
data = sock.recv(1024)
I run this code on computer A. I send UDP commands from computer B in these two situations:
- Both A and B are connected to a router in a local network via LAN cable.
- Both A and B are connected to router over Wifi.
The UDP packets are received in situaltion 1 (LAN Cable) but not in situation 2 (over Wifi). In both the cases Wireshark shows the received packet on computer A. Any thoughts?
OS: Windows
The client program:
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.sendto(char,("192.168.1.107",10005))
sock.close()
I have come close to finding the solution. Windows is dropping the UDP packets. I checked with netstat -s -p UDP
command. Whenever the sending computer sends the UDP packets, the Receive Errors increase. Now I just have to figure out why the packets are being received erroneously.
Edit I have tested it on other computers. It works. I have switched of the firewall on the computer where it doesn't work but still can not figure out what is filtering out the UDP packet.
netstat -r
and show the output here. – Shiplu Mokaddimnetstat -r
to make it easier to answer. I didnt know about that when I started using Stackoverflow. – Protagonist