Tokio Stream Multiplexor
TL;DR: Multiplex multiple streams over a single stream. Has a TcpListener / TcpSocket style interface, and uses u16 ports similar to TCP itself.
[]
= "1.2.3"
Why?
Because sometimes you wanna cram as much shite down one TCP stream as you possibly can, rather than have your application connect with multiple ports.
But Whyyyyyy?
Because I needed it. Inspired by async-smux, written for Tokio.
What about performance?
Doesn't this whole protocol in a protocol thing hurt perf?
Sure, but take a look at the benches:
throughput/tcp time:
thrpt:
throughput/mux time:
thrpt:
Approximately 4.5 times slower than TCP, but still able to shovel 1.8 GiB/s of shite... Seems alright to me. (Numbers could possibly be improved with some tuning of the config params too.)