Broadcast socket bind on Windows; '<broadcast>' or ''

Jp Calderone exarkun at intarweb.us
Sat Feb 15 23:51:25 EST 2003


On Sat, Feb 15, 2003 at 11:47:40PM -0500, Jp Calderone wrote:
> 
>   Binding to <broadcast> is the same as binding to '255.255.255.255' on
> Linux, while binding to '' is the same as binding to '0.0.0.0' (in some
> systems, there is no difference between these two addresses).  The string
> "<broadcast>" is not part of any kind of standard, though.  Your best bet is
> to bind to '255.255.255.255', then use setsockopt() to enable SO_BROADCAST.
> 

  Ahh, I should have looked at the Python docs :P  "<broadcast>" is in fact
defined by Python to be the same as INADDR_BROADCAST.  So I too am curious
why it does not work on Windows.

>   Jp
-- 
 up 7 days, 8:28, 2 users, load average: 0.07, 0.04, 0.00
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030215/98386978/attachment.sig>


More information about the Python-list mailing list