windows - Recieving broadcast UDP in a specific interface in python -


i using following snippet listen incoming broadcast udp packets (dhcp) on windows computer 2 interfaces - lan , wlan.

import socket  s = socket.socket(socket.af_inet, socket.sock_dgram) s.setsockopt(socket.sol_socket, socket.so_reuseaddr, 1) s.setsockopt(socket.sol_socket, socket.so_broadcast, 1) s.bind(('', 67)) s.recvfrom(1024) 

i intersted in packets in lan (a laptop connected directly), i packets wlan (packets send real dhcp). assigned manually ip lan interface, , tried disable other interfaces (without restarting), socket doesn't receive broadcast packets in lan @ all.

this part of cross-platform python pxe server. (based on pypxe)

is there solution, or should try implement using raw socket?


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -