This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kiilerix
Recipients docs@python, kiilerix, pitrou
Date 2012-01-06.22:13:49
SpamBayes Score 0.0015987563
Marked as misclassified No
Message-id <1325888030.3.0.0416342115288.issue13724@psf.upfronthosting.co.za>
In-reply-to
Content
Forked from issue13721 where I was too lazy to report it separately:

http://docs.python.org/release/2.7.2/library/socket#socket.create_connection doesn't describe how it loops over all IP addresses. That seems to be the functions main advantage (and a gotcha) compared to creating the socket and connecting directly.

I propose to warn that it might "hang" up to n*timeout before anything happens with something like this in documentation and docstring:

... and return the socket object.
If the host resolves to multiple IP addresses then they will all be tried in turn until one of them succeeds.
Passing the optional timeout parameter will set the timeout on the socket instance before each attempt to connect.
If no ...
History
Date User Action Args
2012-01-06 22:13:50kiilerixsetrecipients: + kiilerix, pitrou, docs@python
2012-01-06 22:13:50kiilerixsetmessageid: <1325888030.3.0.0416342115288.issue13724@psf.upfronthosting.co.za>
2012-01-06 22:13:49kiilerixlinkissue13724 messages
2012-01-06 22:13:49kiilerixcreate