[Pythonmac-SIG] Solved: problem with socket library in 2.0?

Jack Jansen jack@oratrix.nl
Fri, 02 Feb 2001 09:54:28 +0100


> I found the answer in the socket HowTo, which I didn't know about 
> until I saw one of my students reading it this afternoon. I was using 
> '127.0.0.1' as the address of the server socket, thereby rendering it 
> invisible to other machines.
> 
> This is new in 2.0. Is this another one of those cases where the 
> behavior in 1.5.2 was convenient but incorrect?

The old behaviour was probably because Python 1.5.2 used GUSI 1 for socket 
I/O, which was implemented with MacTCP, which didn't understand about multiple 
network addresses per machine, so a listen() ignored the source IP address.

Python 2 uses GUSI 2 which is implemented with Open Transport, which does know 
about multihoming, so the source IP address is suddenly important.

Note that the normal way to do a listen(), on both 1.5.2 and 2.0, is not to 
pass any source IP address at all, in which case the listen() will happen on 
all IP addresses of the machine automatically.
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm