[New-bugs-announce] [issue45351] List all sockets in TCP echo server using streams

Olaf van der Spek report at bugs.python.org
Sun Oct 3 07:58:21 EDT 2021


New submission from Olaf van der Spek <olafvdspek at gmail.com>:

Replace:
addr = server.sockets[0].getsockname()
print(f'Serving on {addr}')

By:
for socket in server.sockets: 
  addr = socket.getsockname()
  print(f'Serving on {addr}')

https://docs.python.org/3/library/asyncio-stream.html

----------
assignee: docs at python
components: Documentation
messages: 403084
nosy: docs at python, olafvdspek
priority: normal
severity: normal
status: open
title: List all sockets in TCP echo server using streams

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45351>
_______________________________________


More information about the New-bugs-announce mailing list