Communicating across the network
So, we've covered how asyncio works and a bunch of tools that could be used to manage the execution of multiple streams of code. That's all great, but what about doing some actual I/O with it?
The primary motivation for people to use asynchronous I/O is because it helps when writing network clients and servers, although that's certainly not the only possible use. So, asyncio not only makes network communications efficient, it also makes them easy.
Creating a simple client in asyncio
Here, we have the code for a simple client-server pair of programs (refer to the following code example):

They not only read and write the same few bytes over and over, but they also serve to demonstrate everything needed to communicate across the network.
There will be little information about the client that is mysterious.
Run the following command:
python3 client.py
It runs only a single task that uses asyncio's high-level API to open a connection and then send and receive data through...