Examples of how to implement simple pipelined and multiplexed protocols using tokio-proto.
Clone this repo, then cd
into simple
. Then, run the
following command:
$ cargo run --example echo_client_server
You should see the following:
SERVER: "Hello"
CLIENT: "Hello"
SERVER: "Goodbye"
CLIENT: "Goodbye"
This repository includes a number of examples that demonstrate how to use tokio-proto:
- simple implements a simple line-based protocol with an example of how to use it.
- multiplexed implements a simple multiplexed protocol with an example of how to use it.
- streaming implements a line-based protocol that is able to stream requests and responses with an example of how to use it.
- handshake shows how to handle the handshake phase of a protocol, this may include SSL, authentication, etc...
- ping_pong shows how to implement protocol logic at the transport layer.
- stream_client shows how to use a transport directly without using tokio-proto. This makes sense for protocols that aren't request / response oriented.
Tokio is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.
See LICENSE-APACHE, and LICENSE-MIT for details.