2 releases (1 stable)
1.0.0 | Mar 14, 2021 |
---|---|
0.1.0 | Feb 27, 2021 |
#7 in #listening
55KB
1.5K
SLoC
libutp-rs
An async rust interface to libutp.
Examples
A simple ucat implementation is provided in examples/ucat.rs
// Bind to 5000
cargo run --example ucat 127.0.0.1:5000
Listening for connection on 127.0.0.1:5000
Hi!
// Bind to 5001 and connect to 5000
cargo run --example ucat 127.0.0.1:5001 127.0.0.1:5000
Connecting to 127.0.0.1:5000
Hi!
lib.rs
:
An async interface to libutp.
The main interface of this crate is through the UtpContext
, UtpSocket
and UtpListener
structs.
In addition to this, the wrappers
module exposes the unsafe lower level API that the crate is built on,
which is more in line with the original libutp interface.
CAUTION: Use at your own risk! This crate is a best-effort attempt to provide a safe interface, but FFI is inherently unsafe and I (the author) do not have expert knowledge of unsafe rust nor the libutp codebase.
Dependencies
~4–13MB
~142K SLoC