net-mux 0.2.0

A Net Stream Multiplexing Library
Documentation

GitHub Crates.io MIT licensed Build Status

net-mux is an asynchronous connection multiplexing library built on tokio. It multiplexes ordered, connection-oriented transports such as TCP, KCP, and TLS-over-TCP into multiple logical concurrent, ordered, bidirectional streams.

system architecture

Getting Started

Examples

$ cargo run --example tcp_server
$ cargo run --example tcp_client

This launches a TCP listener on the local loopback address, waiting for client connections. Each connection is wrapped as a mux session. The server and client interact over this single connection through multiple streams. The server receives messages from the client and writes them back unchanged, while the client reads strings from the standard input, sends them to the server, and prints the received messages.

Links

Contribution

The project is currently under active development, all feedback welcome!