Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
889a5101
Commit
889a5101
authored
Jan 12, 2012
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #13724: improve documentation for socket.create_connection.
parent
0010256d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
Doc/library/socket.rst
Doc/library/socket.rst
+11
-4
No files found.
Doc/library/socket.rst
View file @
889a5101
...
@@ -236,10 +236,17 @@ The module :mod:`socket` exports the following constants and functions:
...
@@ -236,10 +236,17 @@ The module :mod:`socket` exports the following constants and functions:
.. function:: create_connection(address[, timeout[, source_address]])
.. function:: create_connection(address[, timeout[, source_address]])
Convenience function. Connect to *address* (a 2-tuple ``(host, port)``),
Connect to a TCP service listening on the Internet *address* (a 2-tuple
and return the socket object. Passing the optional *timeout* parameter will
``(host, port)``), and return the socket object. This is a higher-level
set the timeout on the socket instance before attempting to connect. If no
function than :meth:`socket.connect`: if *host* is a non-numeric hostname,
*timeout* is supplied, the global default timeout setting returned by
it will try to resolve it for both :data:`AF_INET` and :data:`AF_INET6`,
and then try to connect to all possible addresses in turn until a
connection succeeds. This makes it easy to write clients that are
compatible to both IPv4 and IPv6.
Passing the optional *timeout* parameter will set the timeout on the
socket instance before attempting to connect. If no *timeout* is
supplied, the global default timeout setting returned by
:func:`getdefaulttimeout` is used.
:func:`getdefaulttimeout` is used.
If supplied, *source_address* must be a 2-tuple ``(host, port)`` for the
If supplied, *source_address* must be a 2-tuple ``(host, port)`` for the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment