diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-11-24 20:40:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-24 20:40:09 (GMT) |
commit | 151c9bf649a049f52df388a8f2390988949abf59 (patch) | |
tree | 1b1b0579dc9bd20af465e98c0a5be471ef5ea08b /Doc/library | |
parent | 455ed45d7c30c5f2a31c524b015c48ac85f3d27c (diff) | |
download | cpython-151c9bf649a049f52df388a8f2390988949abf59.zip cpython-151c9bf649a049f52df388a8f2390988949abf59.tar.gz cpython-151c9bf649a049f52df388a8f2390988949abf59.tar.bz2 |
bpo-45693: Document `port` parameter to `loop.create_server` (GH-29760) (GH-29763)
Document the `port` parameter to `loop.create_server` in `asyncio`. In
particular, note that if `host` resolves to multiple network interfaces,
passing in `port=0` will result in a different random unused port being
used for each interface.
Automerge-Triggered-By: GH:ericvsmith
(cherry picked from commit d71c7bc7339eb82de493c66ebbbfa1cad250ac78)
Co-authored-by: Jim Crist-Harif <jcristharif@gmail.com>
Co-authored-by: Jim Crist-Harif <jcristharif@gmail.com>
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/asyncio-eventloop.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 4a64475..d70aeae 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -626,6 +626,11 @@ Creating network servers assumed and a list of multiple sockets will be returned (most likely one for IPv4 and another one for IPv6). + * The *port* parameter can be set to specify which port the server should + listen on. If ``0`` or ``None`` (the default), a random unused port will + be selected (note that if *host* resolves to multiple network interfaces, + a different random port will be selected for each interface). + * *family* can be set to either :data:`socket.AF_INET` or :data:`~socket.AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* will be determined from host name |