The problem there is probably the DNS resolution.  I like the way apple does it: they resolve AAAA and A in parallel.  Whatever comes back first is being used for the connection attempt.  Much better than waiting for a ~5 second timeout on AAAA before calling back to A.