A sample tokio server that presents a simple command line interface to multiple connecting clients.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
Cargo.lock
Cargo.toml
LICENSE
README.md

README.md

cliserver_rust

WIP - Much TODO

A simple interactive command-line server built in Rust using Tokio. This was built as a learning exercise for myself to translate my knowledge of libevent in C and EventMachine in Ruby to Rust. It is based in concept on my original cliserver example code for libevent, using the Tokio echo server example to get started.

Clients connect to the server on port 14311, allowing them to run the following commands:

  • echo -- Print the command line.
  • help -- Print a list of commands and their descriptions.
  • info -- Print connection information.
  • quit -- Disconnect from the server.
  • kill -- Shut down the server.

Compiling cliserver_rust

Compile the server with cargo build, run it with cargo run. Connect to the server using netcat: nc localhost 14311.

Copyright

(C)2017 Mike Bourgeous, licensed under 2-clause BSD