Socket bug (maybe)

Michael Ströder michael at stroeder.com
Wed May 24 03:16:08 EDT 2000


Ryan Dhuse wrote:
> 
> It really depends on your point of view rather or not you consider this a
> bug.  When a socket is bound to '', it will accept connections from any ip
> address.

I would like to bind a server to any IP interface available in the
system. Then I should set '' as the server's IP address. Right?

> I realize the socket documentation says that '' represents localhost, but I
> would prefer if '' was equivalent to 'localhost' in all respects.

I'm confused here. The socket module docs say:

---------------------------------------------------------------
For IP addresses, two special forms are accepted instead of a host
address: the empty string represents INADDR_ANY, and the string
'<broadcast>' represents INADDR_BROADCAST.
---------------------------------------------------------------

INADDR_ANY is IMHO not localhost.

Ciao, Michael.



More information about the Python-list mailing list