Skip to content

mmisono/aa_echo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

async/await echo server example

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.

Architecture

The below figure shows the sequence of accept in async/await echo server.

The sequence of accept

How to test

  1. Run a server
    • e.g., cargo run --bin aa_echo
  2. Connect to the server in other terminal
    • e.g., nc 127.0.0.1 8080 and then type something

References

License

CC0

About

async/await echo server in rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages