mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
asyncio: Remove duplicate bind addresses in create_server.
Patch by Sebastien Bourdeauducq (issue #26338)
This commit is contained in:
parent
f9e1f2bda9
commit
e076ffb068
2 changed files with 18 additions and 12 deletions
|
@ -880,7 +880,10 @@ class BaseEventLoop(events.AbstractEventLoop):
|
|||
to host and port.
|
||||
|
||||
The host parameter can also be a sequence of strings and in that case
|
||||
the TCP server is bound to all hosts of the sequence.
|
||||
the TCP server is bound to all hosts of the sequence. If a host
|
||||
appears multiple times (possibly indirectly e.g. when hostnames
|
||||
resolve to the same IP address), the server is only bound once to that
|
||||
host.
|
||||
|
||||
Return a Server object which can be used to stop the service.
|
||||
|
||||
|
@ -909,7 +912,7 @@ class BaseEventLoop(events.AbstractEventLoop):
|
|||
flags=flags)
|
||||
for host in hosts]
|
||||
infos = yield from tasks.gather(*fs, loop=self)
|
||||
infos = itertools.chain.from_iterable(infos)
|
||||
infos = set(itertools.chain.from_iterable(infos))
|
||||
|
||||
completed = False
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue