Scanning for local servers, getting a broadcast address

Noah noah at noah.org
Mon Jun 9 18:58:41 EDT 2003


Irmen de Jong <irmen at -NOSPAM-REMOVETHIS-xs4all.nl> wrote in message news:<3ee4ae9b$0$49113$e4fe514c at news.xs4all.nl>...
> 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

Ah, yes, of course. But I did not know that you could use
'<broadcast>' for the bind side. Does that tell it to
listen on all available interfaces?

Yours,
Noah




More information about the Python-list mailing list