Accepting TCP Traffic with Tokio
In the previous chapter, we managed to get actors running in different threads to send messages to each other. While it is exciting to code the building blocks for async programming, we left that chapter with a not-very-practical application. In this chapter, we will be creating a server with Tokio that listens to TCP traffic on a port. If messages are sent, our TCP server will process the incoming data, perform operations through a series of actors and threads, and then return the updated data to the client.
In this chapter, we will cover the following topics:
- Exploring TCP
- Accepting TCP
- Processing bytes
- Passing TCP to an actor
- Keeping track of orders with actors
- Chaining communication between actors
- Responding with TCP
- Sending different commands via the client
By the end of this chapter, you will understand how to use TCP and how to package and unpack data sent via TCP with bytes. With this knowledge,...