Crate udt [] [src]

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.

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 mut 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);

Modules

UdtOpts

Various options that can be passed to getsockopt or setsockopt

Structs

Epoll

Used with the epoll* methods of a UDTSocket

Linger

Linger option

UdtError
UdtSocket

A UDT Socket

Enums

SocketFamily
SocketType

Socket type

UdtStatus

Traits

UdtOption

Functions

init

Initialize the UDT library.