Sometimes I have to send a message to a specific IP and sometimes I send messages to all the IPs in my network it happens . At the other end, I have to make a difference between a broadcast and a normal middle but the code returned by the recvfrom ()
message comes back; There is no difference between them.
Can I help someone recognize me? 'It does not seem that it is possible with the python's socket
module UDP is a very low protocol, and the only way to differentiate between a broadcast and a non-broadcast UDP packet is by looking at the destination address . However, you can not inspect that part of the packet with BSD Socket API (if I remember it correctly), and the socket
module exposes BSD Socket API only. Your best bet would be to use the first byte of this message whether or not it is a broadcast or a unicast message.
Comments
Post a Comment