Linux Networking Programming

Trio Tutorial – Simple TCP Chat Program – Part 3


Part 1:

Part 2:

In part 3 we build more of the server. We build out the functionality to receive messages, then distribute them to all connected users.

For this part we use Trio’s nurseries to start up new running tasks:

We use the nursery.start_soon() function to kick off new tasks in the background.

The other tool we use another tool from Trio, the memory channels:

For this we use the trio.open_memory_channel() function to create a channel and get a send+receive channel, which we then use to distribute the messages between connected users.

Got any questions? Contact me:

Leave a Reply

Your email address will not be published. Required fields are marked *