Expand description
Implementation of the Micro Transport Protocol.
This library provides both a socket interface (UtpSocket
) and a stream
interface (UtpStream
).
I recommend that you use UtpStream
, as it implements the Read
and
Write
traits we all know (and love) from std::io
, which makes it
generally easier to work with than UtpSocket
.
§Installation
Ensure your Cargo.toml
contains:
[dependencies]
utp = "*"
Structs§
- Buffered
UtpStream - A buffered
UtpStream
to avoid making too many system calls when sending small amounts of data through utp - UtpSocket
- A reference to an existing
UtpSocket
that can be shared amongst multiple tasks. This can’t function unless the correspondingUtpSocketDriver
is scheduled to run on the same runtime. - UtpStream
- A
UtpStream
that can be used to read and write in a more convenient fashion with theAsyncRead
andAsyncWrite
traits. - UtpStream
Driver - This is a
Future
that takes care of handling all events related to aUtpStream
.UtpStream
won’t receive neither send any data until this driver is spawned as a tokio task.