Scanning for local servers, getting a broadcast address

Irmen de Jong irmen at -NOSPAM-REMOVETHIS-xs4all.nl
Mon Jun 9 11:58:21 EDT 2003


Noah wrote:

> s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
> s.bind( ('', 2003) )

            ^^

Note that on some platforms this doesn't work if you have multiple
network addresses. You have to use either "<broadcast>" or the
unique ip address of the network adapter you want to receive the
broadcast packets on.

--Irmen





More information about the Python-list mailing list