socket send help

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Jan 5 12:42:39 EST 2009


En Sat, 03 Jan 2009 21:44:34 -0200, Bryan Olson <fakeaddress at nowhere.org>  
escribió:

> Gabriel Genellina wrote:
>> greywine at gmail.com escribió:
> [...]
>>> A simple server:
>>>
>>> from socket import *
>>> myHost = ''
>>  Try with myHost = '127.0.0.1' instead - a firewall might be blocking  
>> your server.
>
> Just a nit: I'd say the reason to use '127.0.0.1' instead of the empty  
> string is that a firewall might *not* be blocking your server.
>
> The Python sockets module interprets the empty string as INADDR_ANY,  
> which means to bind to all available adapters including the loopback,  
> A.K.A localhost, A.K.A '127.0.0.1'.

I thought a firewall would block an attempt to bind to any routeable  
address, but not to localhost. So using INADDR_ANY would be rejected.

-- 
Gabriel Genellina




More information about the Python-list mailing list