Message150772
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 ... |
|
Date |
User |
Action |
Args |
2012-01-06 22:13:50 | kiilerix | set | recipients:
+ kiilerix, pitrou, docs@python |
2012-01-06 22:13:50 | kiilerix | set | messageid: <1325888030.3.0.0416342115288.issue13724@psf.upfronthosting.co.za> |
2012-01-06 22:13:49 | kiilerix | link | issue13724 messages |
2012-01-06 22:13:49 | kiilerix | create | |
|