#udp #socket #udt4

udt

Bindings to udt, a high performance data transfer protocol (based on UDP)

5 releases

Uses old Rust 2015

0.2.0 Aug 17, 2016
0.1.4 Oct 11, 2015
0.1.2 Oct 7, 2015
0.1.1 Oct 5, 2015
0.1.0 Oct 4, 2015

#3 in #udt

Download history 25/week @ 2023-10-19 30/week @ 2023-10-26 24/week @ 2023-11-02 28/week @ 2023-11-09 26/week @ 2023-11-16 25/week @ 2023-11-23 23/week @ 2023-11-30 18/week @ 2023-12-07 24/week @ 2023-12-14 26/week @ 2023-12-21 10/week @ 2023-12-28 14/week @ 2024-01-04 24/week @ 2024-01-11 27/week @ 2024-01-18 16/week @ 2024-01-25 16/week @ 2024-02-01

84 downloads per month
Used in shoop

BSD-3-Clause

45KB
575 lines

udt-rs

UDT bindings for rust

What is UDT?

See http://udt.sourceforge.net/

Documentation and examples

In progress, see the documentation

License

The bindings are distributed under a BSD license.

UDT is distributed under a BSD license (copyright held by The Board of Trustees of the University of Illinois). See here

The wrapper is distributed user a BSD license (copyright held by Brave New Software). See here


lib.rs:

Note about these docs

These docs are mostly copied verbatim from the UDT documentation. If you see references to the C++ function names instead of the rust function names, that's why.

UDT

Bindings to the UDT4 high performance data data transfer library

UDT follows closely the BSD socket API, but several of the functions have different semantics.

UDT is a high performance data transfer protocol - UDP-based data transfer protocol. It was designed for data intensive applications over high speed wide area networks, to overcome the efficiency and fairness problems of TCP. As its name indicates, UDT is built on top of UDP and it provides both reliable data streaming and messaging services.

Examples

To create a Datagram server, that can send and receive messages:

    use std::str::FromStr;
    use std::net::{SocketAddr, SocketAddrV4};
    use udt::*;

    let localhost = std::net::Ipv4Addr::from_str("127.0.0.1").unwrap();

    let sock = UdtSocket::new(SocketFamily::AFInet, SocketType::Stream).unwrap();
    sock.bind(SocketAddr::V4(SocketAddrV4::new(localhost, 0))).unwrap();
    let my_addr = sock.getsockname().unwrap();
    println!("Server bound to {:?}", my_addr);
    sock.listen(5).unwrap();
    let (mut new_socket, peer) = sock.accept().unwrap();
    println!("Received new connection from peer {:?}", peer);


Various options that can be passed to getsockopt or setsockopt

These are typed in such a way so that when they are used with getsockopt or setsockopt, they will require the right data type.

Examples

use udt::*;

let sock = UdtSocket::new(SocketFamily::AFInet, SocketType::Stream).unwrap();
let recv_buf: i32 = sock.getsockopt(UdtOpts::UDT_RCVBUF).unwrap();
let rendezvous: bool = sock.getsockopt(UdtOpts::UDT_RENDEZVOUS).unwrap();

Dependencies

~335KB