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 = Arc::new(Mutex::new(Vec::new()));

    let mut transport = Transport::bind("127.0.0.1:9000", false)?;
    transport = transport.with_delivery_callback(delivered.clone());

    eprintln!("Transport listening on 127.0.0.1:9000");
    eprintln!("Waiting for packets...");
    eprintln!("Press Ctrl+C to exit");

    transport.run();

    Ok(())
}