A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-January/085033.html below:

[Python-Dev] socket.create_connection slow

[Python-Dev] socket.create_connection slow [Python-Dev] socket.create_connection slowKristján Valur Jónsson kristjan at ccpgames.com
Wed Jan 14 12:23:46 CET 2009
Greetings.
I spent the morning trying to find out why the disabled tests in test_xmlrpc.py ran so slowly on my vista box.
After much digging, I found that it boiled down to socket.create_connection() trying to connect to "localhost", port.

You see, it does a getaddrinfo() and then tries to connect using all the various addresses it finds until it succeeds.
On Vista, it will return an AF_INET6 entry before the AF_INET one and try connection to that.  This connect() attemt fails after approximately one second, after which we proceed to do an immediately successful connect() call to the AF_INET address.

Now, I did fix this in test_xmlrpc.py by just speficying the loopback address, but I wonder if this might not be a problem in general?

I can think of two things to make this better:

1)      Make sure that AF_INET addresses are tried first in socket.create_connection()

2)      Have the SocketServer create a listening socket for each address family by default.

Any thoughts?

K
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20090114/be115ba0/attachment.htm>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4