diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-10-11 19:34:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-11 19:34:47 (GMT) |
commit | bb4f885892be0c337db3a81ef2936be0b3855de3 (patch) | |
tree | af26bb3c59a3cdf56b5b03cc078ce66f37bcc883 /Doc | |
parent | 56825b697e0831bf431fd83c59dc5c4d35292560 (diff) | |
download | cpython-bb4f885892be0c337db3a81ef2936be0b3855de3.zip cpython-bb4f885892be0c337db3a81ef2936be0b3855de3.tar.gz cpython-bb4f885892be0c337db3a81ef2936be0b3855de3.tar.bz2 |
bpo-45351, asyncio: Enhance echo server example, print all addresses (GH-28828)
(cherry picked from commit 659812b451aefe1f0e5f83540296519a5fb8f313)
Co-authored-by: Olaf van der Spek <olafvdspek@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/asyncio-stream.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/asyncio-stream.rst b/Doc/library/asyncio-stream.rst index b3e229c..95a8e46 100644 --- a/Doc/library/asyncio-stream.rst +++ b/Doc/library/asyncio-stream.rst @@ -395,8 +395,8 @@ TCP echo server using the :func:`asyncio.start_server` function:: server = await asyncio.start_server( handle_echo, '127.0.0.1', 8888) - addr = server.sockets[0].getsockname() - print(f'Serving on {addr}') + addrs = ', '.join(str(sock.getsockname()) for sock in server.sockets) + print(f'Serving on {addrs}') async with server: await server.serve_forever() |