Re: [Python-Dev] socket.create_connection slow

2009-01-15 Thread Kristján Valur Jónsson
do we want to bug MS about this? Clearly it is a performance problem when implementing dual stack clients. K -Original Message- From: Martin v. Löwis [mailto:mar...@v.loewis.de] Sent: 15. janúar 2009 00:07 To: Kristján Valur Jónsson Cc: python-dev@python.org Subject: Re: [Python-Dev

Re: [Python-Dev] socket.create_connection slow

2009-01-15 Thread Martin v. Löwis
Right, there is no way to try to simultaneously connect using ipv4 and ipv6, apparently. Ah, I see what you meant. No, this cannot work - what if you get positive ACKs on both protocols? Also, the problem with setting the registry TcpConnectMaxRetries registry entry is that it also affects

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Antoine Pitrou
Kristján Valur Jónsson kristjan at ccpgames.com writes: 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

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Victor Stinner
Hi, Le Wednesday 14 January 2009 12:23:46 Kristján Valur Jónsson, vous avez écrit : socket.create_connection() trying to connect to (localhost, port) (...) return an AF_INET6 entry before the AF_INET one and try connection to that. This connect() attemt fails after approximately one

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Kristján Valur Jónsson
=ccpgames@python.org] On Behalf Of Antoine Pitrou Sent: 14. janúar 2009 11:34 To: python-dev@python.org Subject: Re: [Python-Dev] socket.create_connection slow Kristján Valur Jónsson kristjan at ccpgames.com writes: On Vista, it will return an AF_INET6 entry before the AF_INET one and try

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Michael Foord
Victor Stinner wrote: Hi, Le Wednesday 14 January 2009 12:23:46 Kristján Valur Jónsson, vous avez écrit : socket.create_connection() trying to connect to (localhost, port) (...) return an AF_INET6 entry before the AF_INET one and try connection to that. This connect() attemt fails after

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Kristján Valur Jónsson
Message- From: python-dev-bounces+kristjan=ccpgames@python.org [mailto:python-dev-bounces+kristjan=ccpgames@python.org] On Behalf Of Victor Stinner Sent: 14. janúar 2009 12:46 To: python-dev@python.org Subject: Re: [Python-Dev] socket.create_connection slow Hi, Le Wednesday 14 January

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Billy Earney
AM To: Victor Stinner; python-dev@python.org Subject: Re: [Python-Dev] socket.create_connection slow I have no idea why the connect refusal takes so long. Maybe it's a vista thing? from socket import * socket(AF_INET6).connect((::1, 8080)) takes about one second to report active refusal. But so

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Michael Foord wrote: Victor Stinner wrote: Hi, Le Wednesday 14 January 2009 12:23:46 Kristján Valur Jónsson, vous avez écrit : socket.create_connection() trying to connect to (localhost, port) (...) return an AF_INET6 entry before the

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Kristján Valur Jónsson
] On Behalf Of Billy Earney Sent: 14. janúar 2009 15:43 To: python-dev@python.org Subject: Re: [Python-Dev] socket.create_connection slow This may be way out on a limb, but could it be a reverse lookup issue? ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Martin v. Löwis
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. Can you find out why it takes a second? That

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Martin v. Löwis
Anyone that wants to use socket.create_connection() to create a stream socket to a host whose name has both an Ipv4 and Ipv6 address. Unless the host is listening on its Ipv6 port, an unsuccessful connection attempt will first be made, taking approximately one second. Again, it is a bug in

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Martin v. Löwis
It barfs on Macs as well: indeed, it is worse, because the connection just fails there, rather than trying IPv6 and then falling back to IPv4. That depends on the application. Some applications fall back (as they should, if they added their support for IPv6 correctly), some don't. For

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Martin v. Löwis
I have no idea why the connect refusal takes so long. Can you run wireshark, to find out whether it's sending out any requests that don't get responses? Could it be that your firewall is discarding the connection request? (rather than sending an ICMP destination unreachable back) Anything

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Martin v. Löwis
I have no idea why the connect refusal takes so long. Maybe it's a vista thing? I've looked into this further. It doesn't just happen for localhost, but also for remote hosts, and not just for IPv6, but also for IPv4, and not just for Vista, but also for XP. The problem is this: 1. Vista sends

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Kristján Valur Jónsson
-dev@python.org Subject: Re: [Python-Dev] socket.create_connection slow I have no idea why the connect refusal takes so long. Maybe it's a vista thing? I've looked into this further. It doesn't just happen for localhost, but also for remote hosts, and not just for IPv6, but also for IPv4

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Kristján Valur Jónsson
Valur Jónsson Sent: 14. janúar 2009 21:40 To: Martin v. Löwis Cc: python-dev@python.org Subject: Re: [Python-Dev] socket.create_connection slow 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

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Eric Smith
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

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Steve Holden
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

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Martin v. Löwis
Yet another undefined thing affecting us, Martin. I think it's just another case of Microsoft says it's undefined, even though the standards clearly specify what the behavior must be, and Microsoft managed to implement the behavior that not only violates the specification, but also hurts users

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Scott Dial
Kristján Valur Jónsson wrote: 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

Re: [Python-Dev] socket.create_connection slow

2009-01-14 Thread Martin v. Löwis
And Microsoft, realizing their problem , came up with this: http://msdn.microsoft.com/en-us/library/bb513665(VS.85).aspx Dual-stacked sockets are a useful thing to have (so useful that Linux made them the default, despite that the RFC says that the default should be IPV6_V6ONLY). The Python