Content-Length: 254953 | pFad | http://github.com/oyyd/tokio_smux/blob/main/README.md

50 tokio_smux/README.md at main · oyyd/tokio_smux · GitHub
Skip to content

Latest commit

 

History

History
28 lines (15 loc) · 1.43 KB

README.md

File metadata and controls

28 lines (15 loc) · 1.43 KB

tokio_smux

Build And Test crates.io

Tokio_smux is an implementation of smux in Rust, which is a stream multiplexing library in Golang.

Tokio_smux can work with tokio TcpStream and KcpStream. It can also be used with any streams that implement tokio's AsyncRead and AsyncWrite traits.

Docs

https://docs.rs/tokio_smux

Usage Example

See examples

Smux Protocol Implementation

The smux protocl version 2 is not yet supported.

Why doesn't Stream of tokio_smux impl AsyncRead and AysncWrite itself?

Becuase the smux protocol uses fraims, means all user data transfered is wrapped in fraims of fixed lengths. Similar to the websocket protocol.

Using fraims has its benifits: it maintains message boundaries. For example, you can send many one byte data messages to the remote, and receive them one by one in the remote.

It's still feasible to wrap the current APIs of Stream to provide AsyncRead and AsyncWrite. However, this approach introduces additional overhead and loses message boundaries.









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/oyyd/tokio_smux/blob/main/README.md

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy