New submission from Mads Kiilerich <m...@kiilerich.com>:

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 ...

----------
assignee: docs@python
components: Documentation
messages: 150772
nosy: docs@python, kiilerix, pitrou
priority: normal
severity: normal
status: open
title: socket.create_connection and multiple IP addresses
type: enhancement
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13724>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to