diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2010-01-03 01:29:44 +0000 |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2010-01-03 01:29:44 +0000 |
commit | 79a3eb1058057185cb901b0f5f67fea05494e1fb (patch) | |
tree | 09456d423e27dfe76cf46079f944ae877f16e492 /Doc | |
parent | 7f8ebdbad54015074c71786abbfa7ea74fe69c56 (diff) | |
download | cpython-git-79a3eb1058057185cb901b0f5f67fea05494e1fb.tar.gz |
Adds an optional source_address parameter to socket.create_connection().
For use by issue3972.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/socket.rst | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index d778369b21..2e0c6d678b 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -205,7 +205,7 @@ The module :mod:`socket` exports the following constants and functions: .. versionadded:: 2.3 -.. function:: create_connection(address[, timeout]) +.. function:: create_connection(address[, timeout[, source_address]]) Convenience function. Connect to *address* (a 2-tuple ``(host, port)``), and return the socket object. Passing the optional *timeout* parameter will @@ -215,6 +215,12 @@ The module :mod:`socket` exports the following constants and functions: .. versionadded:: 2.6 + If supplied, *source_address* must be a 2-tuple ``(host, port)`` for the + 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. + + .. versionadded:: 2.7 + .. function:: getaddrinfo(host, port[, family[, socktype[, proto[, flags]]]]) |