[Python-Dev] socket.create_connection slow (original) (raw)

Steve Holden steve at holdenweb.com
Wed Jan 14 23:23:16 CET 2009


Eric Smith wrote:

Kristján Valur Jónsson wrote:

Aha, thanks, since my wireshark wasn't working. I boiled a few pints of water (thanks, Google) and came up with this:

http://support.microsoft.com/kb/175523 Here is the summary: Note that with other implementations of TCP, such as those commonly found in many UNIX systems, the connect() fails immediately upon the receipt of the first ACK/RST packet, resulting in the awareness of an error very quickly. However, this behavior is not specified in the RFCs and is left to each implementation to decide. The approach of Microsoft platforms is that the system administrator has the freedom to adjust TCP performance-related settings to their own tastes, namely the maximum retry that defaults to 3. The advantage of this is that the service you're trying to reach may have temporarily shut down and might resurface in between SYN attempts. In this case, it's convenient that the connect() waited long enough to obtain a connection since the service really was there. Yet another "undefined" thing affecting us, Martin. I know it's pointless to express my shock here, but I can't resist. It's truly amazing to me that they'd delay the connect call's failure for a second by default, in hopes that the other end might come back up between SYN's. How often could that possibly happen? When I read it I was tempted to observe they must have been testing Microsoft network services. It is a truly bizarre rationalization of a default that appears to have been taken from DOS-era network client applications. I remember demonstrating the phenomenon on a cli-based Telnet client at least 15 years ago.

regards Steve

Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/



More information about the Python-Dev mailing list