3 A first asyncio application
- How to use sockets to transfer data over a network
- How to use telnet to communicate with a socket-based application
- The issues with blocking sockets, and how to resolve them with non-blocking sockets
- Using selectors to build a simple event loop for non-blocking sockets
- How to use non-blocking sockets with the asyncio event loop
- How to create a non-blocking echo server that allows for multiple connections
- How to handle exceptions in tasks
- How to add custom shutdown logic to an asyncio application
3.1 Working with blocking sockets
3.1.1 Connecting to a server with telnet
3.1.2 Reading and writing data to and from a socket
3.1.3 Allowing multiple connections and the dangers of blocking
3.2 Working with non-blocking sockets
3.3 Using the selectors module to build a socket event loop
3.4 An echo server on the asyncio event loop
3.4.1 Event loop coroutines for sockets
3.4.2 Designing an asyncio echo server
3.4.3 Handling errors in tasks
3.5 Shutting down gracefully
3.5.1 Listening for signals
3.5.2 Waiting for pending tasks to finish
3.6 Summary