Problem binding a socket under solaris
Steffen Ries
steffen.ries at sympatico.ca
Thu May 15 07:57:23 EDT 2003
"Morrow, Paul" <Paul.Morrow at loyaltyworks.com> writes:
>
> The following simple python script works fine under Windows or Linux,
> but under Solaris 9, it gives the error socket.gaierror: (3,
> 'getaddrinfo failed')
>
> import socket
>
> HOST = '' # Symbolic name meaning the local host
> PORT = 50007 # Arbitrary non-privileged port
> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> s.bind((HOST, PORT))
> s.close()
>
> Does anyone have any idea what's going on? I'm running ActiveState's
> 2.2.2 distribution.
I'm not sure what's going on, but I have seen the same problem.
Just define HOST = "0.0.0.0", and it will work on Solaris as well as
Linux and Windows...
/steffen
--
steffen.ries at sympatico.ca <> Gravity is a myth -- the Earth sucks!
More information about the Python-list
mailing list