bind problem

Dan Stromberg strombrg at tesuji.nac.uci.edu
Fri Nov 15 15:34:24 EST 2002


In article <pan.2002.11.15.20.02.26.549858.710 at thomas-guettler.de>,
Thomas Guettler  <pan-newsreader at thomas-guettler.de> wrote:
<On Fri, 15 Nov 2002 18:40:13 +0100, Dan Stromberg wrote:
<
<> I'm still having my previously-mentioned problem binding sockets in
<> python 2.2.  Things are fine on linux, but they don't work on solaris -
<> some solaris hosts, not all, I think.
<> 
<> I'm approaching the group again about it, because I've run across
<> another, much smaller program with the same problem - in fact it's so
<> small, but I think it'll be ok to post it here in its entirety.
<> 
<> The error I get with 2.2.1 is:
<> 
<> Traceback (most recent call last):
<>   File "/tmp/packetpasser", line 108, in ?
<>     main()
<>   File "/tmp/packetpasser", line 60, in main
<>     sockin.bind(('',read_from))
<> socket.gaierror: (3, 'getaddrinfo failed')
<
<"getaddrinfo failed" sounds like you can't resolve 
<the dns-name of a machine to its ip-address.
<
<does "nslookup machine" work?
<
<Does it work if you use ip-adresses instead?
<
< thomas

It appears to be binding the local socket that is failing, rather than
the remote socket.  I tried giving an IP address for the remote socket
anyway, but it didn't seem to help.  nslookup/dig finds the address
ok, and it runs ok on a redhat host.

sockin.bind('',read_from) gives the error mentioned above.

sockin.bind('localhost',read_from) doesn't give an error, but fails to
listen on the specified port.

sockin.bind('127.0.0.1',read_from) exhibits the same behavior as
sockin.bind('localhost',readfrom).

I've been under the impression that '' was supposed to be localhost,
but it does seem to be behaving differently.

Thanks much for your response.
-- 
Dan Stromberg                                               UCI/NACS/DCS



More information about the Python-list mailing list