intentra 0.1.3

High-performance multi-peer UDP transport protocol with cryptographic authentication and DoS protection
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use intentra::transport::Transport;
use parking_lot::Mutex;
use std::sync::Arc;

fn main() -> std::io::Result<()> {
    let delivered_packets = Arc::new(Mutex::new(Vec::new()));
    let delivered_clone = delivered_packets.clone();

    let mut transport = Transport::bind("127.0.0.1:9002", false)?;
    transport = transport.with_delivery_callback(delivered_clone);

    eprintln!("Transport listening on 127.0.0.1:9002");
    eprintln!("Packet delivery callback enabled");

    transport.run();

    Ok(())
}