diff options
author | Olaf van der Spek <olafvdspek@gmail.com> | 2021-10-11 18:54:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-11 18:54:44 (GMT) |
commit | 659812b451aefe1f0e5f83540296519a5fb8f313 (patch) | |
tree | ecde5b87e216a534eeae3753d8e8537546fbd5bb | |
parent | 560a79f94e94de66a18f2a5e4194c2fe51e2adf1 (diff) | |
download | cpython-659812b451aefe1f0e5f83540296519a5fb8f313.zip cpython-659812b451aefe1f0e5f83540296519a5fb8f313.tar.gz cpython-659812b451aefe1f0e5f83540296519a5fb8f313.tar.bz2 |
bpo-45351, asyncio: Enhance echo server example, print all addresses (GH-28828)
-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() |