Hi again, I also added examples of UDP echo client and echo server: https://docs.python.org/dev/library/asyncio-protocol.html#udp-echo-client-protocol https://docs.python.org/dev/library/asyncio-protocol.html#udp-echo-server-protocol
In the UDP echo server example, you have a more concrete example of "waiting until the socket is closed". The create_datagram_endpoint() returns a pair of (transport, protocol), whereas create_server() returns a Server class. The Server class has a close() method but also a wait_closed() method. A transport has a close() method but no wait_closed() method. In the UDP echo server example, tranport.close() is called while the event loop is not running. The transport enters the status "closing", but since the event loop is not run again, the socket is never closed and a ResourceWarning is emitted. Victor
