diff options
Diffstat (limited to 'Doc/library/socket.rst')
-rwxr-xr-x | Doc/library/socket.rst | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index f8392ba..d7a4401 100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -660,7 +660,7 @@ The following functions all create :ref:`socket objects <socket-objects>`. Windows support added. -.. function:: create_connection(address[, timeout[, source_address]]) +.. function:: create_connection(address[, timeout[, source_address[, all_errors]]]) Connect to a TCP service listening on the internet *address* (a 2-tuple ``(host, port)``), and return the socket object. This is a higher-level @@ -679,9 +679,18 @@ The following functions all create :ref:`socket objects <socket-objects>`. socket to bind to as its source address before connecting. If host or port are '' or 0 respectively the OS default behavior will be used. + When a connection cannot be created, an exception is raised. By default, + it is the exception from the last address in the list. If *all_errors* + is ``True``, it is an :exc:`ExceptionGroup` containing the errors of all + attempts. + .. versionchanged:: 3.2 *source_address* was added. + .. versionchanged:: 3.11 + *all_errors* was added. + + .. function:: create_server(address, *, family=AF_INET, backlog=None, reuse_port=False, dualstack_ipv6=False) Convenience function which creates a TCP socket bound to *address* (a 2-tuple |