async/await echo server + α in rust.
- Echo server: This uses blocking socket I/O and handles only one connection at a time.
- Multi-threaded echo server: This is almost same as the blocking one except that it spawn a thread for a each connection to handle multiple connections.
- Epoll echo server : This uses epoll to handle multiple connections in one thread.
- Async/await echo server : Epoll echo server using async/await syntax. I use the same strategy as the async-book to spawn and execute futures. There is a dedicated thread to perform
epoll_wait()
, which is the same as the async-std.
Linux only. Just for learning purposes.
The below figure shows the sequence of accept in async/await echo server.
- Run a server
- e.g.,
cargo run --bin aa_echo
- e.g.,
- Connect to the server in other terminal
- e.g.,
nc 127.0.0.1 8080
and then type something
- e.g.,