3 releases
0.1.2 | May 9, 2024 |
---|---|
0.1.1 | May 8, 2024 |
0.1.0 | May 8, 2024 |
#2 in #constructs
490KB
334 lines
adrnaln
Problem statement: It is desired to send any type of file across UDP with low latency or metadata overhead.
This is a simple library that provides high level constructs to manage a sequence of packets streaming over UDP.
Implementation
This library uses bincode
to assist in the serial/deseralisation of Packet
structs.
These structs contain chunks from input file and also have global metadata about the sequence construction.
Usage
cargo test
to run a synthetic test.
Run the example cargo run --example local_file_transfer -- --filepath <FILEPATH>
( This will currently spit the file into the cwd )
Performance
Flamegraph
To analyze performance use flamegraph
( cargo install flamegraph )
sudo cargo flamegraph --dev --example local_file_transfer -- --filepath <FILEPATH>
Tracing
docker run -d -p6831:6831/udp -p6832:6832/udp -p16686:16686 -p14268:14268 jaegertracing/all-in-one:latest
Create a trace:
RUST_LOG=trace RUSTFLAGS="--cfg tokio_unstable" cargo run --example local_file_transfer -- --filepath=examples/resources/fox.png
Dependencies
~9–19MB
~237K SLoC