mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
asyncio: improve the documentation of servers
- Fix the documentation of Server.close(): it closes sockets - Replace AbstractServer with Server - Document Server.sockets attribute
This commit is contained in:
parent
b28dbac86d
commit
8ebeb03740
3 changed files with 33 additions and 19 deletions
|
|
@ -110,6 +110,8 @@ class Server(events.AbstractServer):
|
|||
return
|
||||
self.sockets = None
|
||||
for sock in sockets:
|
||||
# closing sockets will call asynchronously the _detach() method
|
||||
# which calls _wakeup() for the last socket
|
||||
self._loop._stop_serving(sock)
|
||||
if self._active_count == 0:
|
||||
self._wakeup()
|
||||
|
|
@ -626,7 +628,7 @@ class BaseEventLoop(events.AbstractEventLoop):
|
|||
reuse_address=None):
|
||||
"""Create a TCP server bound to host and port.
|
||||
|
||||
Return an AbstractServer object which can be used to stop the service.
|
||||
Return an Server object which can be used to stop the service.
|
||||
|
||||
This method is a coroutine.
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue