Staging: this is not the live site, pydocs.org.
Networking and Interprocess Communication
Server objects are asynchronous context managers. When used in an async with statement, it’s guaranteed that the Server object is closed and not accepting new connections when the async with statement is completed: Changed in 3.7, 3.11 3.7: Server object is an asynchronous context manager since Python 3.7.3.11: This class was exposed publicly as asyncio.Server in Python 3.9.11, 3.10.3 and 3.11.Members of Server g get_loop Get the event loop the Server object is attached to. i is_serving Return True if the server is accepting connections. s serve_forever Start accepting connections until the coroutine is cancelled. sockets List of socket-like objects, asyncio.trsock.TransportSocket, which the server is listening on. w wait_closed Wait until server is closed and all connections are dropped.
Python docs © Python Software Foundation · Examples CC0 ·
Source on GitHub · Not affiliated with the PSF