newbie - SOAP.py sockets and localhost?

Geoff Gerrietts geoff at gerrietts.net
Mon May 13 20:42:23 EDT 2002


Quoting Gordon Scott (gordon.scott at peregrine.com):
> My question is, why should I have had to specifically state the IP
> instead of localhost?  Shouldn't localhost have bound the socket to
> whatever my current IP address is?

I can't say for absolute certain what the problem is, but I have a
strong suspicion I know.

If you're running on a Linux box, this is easier to explain than if
you're running on a Windows box -- and I think Win2k has a handy
utility (ipconfig maybe?) that can help you shed some light, also.

The fact is that "localhost" maps to the IP address 127.0.0.1, on all
machines. This is the loopback address, and it functions on the
loopback interface. Check out the output from "ifconfig" on a linux
box -- you'll see that there are in fact two different interfaces
indicated, and each with a different IP address.

When you bind a socket for listening, you have the option to either
specify all available network interfaces, or a specific network
interface by IP number. My guess is that SOAP is configured to bind
against one interface, rather than all available interfaces.

If you look into the socket module, you'll see how that works. Once
you see how it works, you should be able to change it, if you're of a
mind.

Best of luck,
--G.

-- 
Geoff Gerrietts             "People talk fundamentals and superlatives 
<geoff at gerrietts net>     and then make some changes of detail." 
http://www.gerrietts.net                  --Oliver Wendell Holmes Jr





More information about the Python-list mailing list