Struct net2::UdpBuilder [] [src]

pub struct UdpBuilder {
    // some fields omitted
}

Methods

impl UdpBuilder
[src]

fn new_v4() -> Result<UdpBuilder>

Constructs a new UdpBuilder with the AF_INET domain, the SOCK_DGRAM type, and with a protocol argument of 0.

Note that passing other kinds of flags or arguments can be done through the FromRaw{Fd,Socket} implementation.

fn new_v6() -> Result<UdpBuilder>

Constructs a new UdpBuilder with the AF_INET6 domain, the SOCK_DGRAM type, and with a protocol argument of 0.

Note that passing other kinds of flags or arguments can be done through the FromRaw{Fd,Socket} implementation.

fn bind<T>(&self, addr: T) -> Result<UdpSocket> where T: ToSocketAddrs

Binds this socket to the specified address.

This function directly corresponds to the bind(2) function on Windows and Unix.

impl UdpBuilder
[src]

fn ttl(&self, ttl: u32) -> Result<&Self>

fn only_v6(&self, only_v6: bool) -> Result<&Self>

fn reuse_address(&self, reuse: bool) -> Result<&Self>

Trait Implementations

impl FromRawSocket for UdpBuilder
[src]

unsafe fn from_raw_socket(fd: SOCKET) -> UdpBuilder

Creates a new I/O object from the given raw socket. Read more

impl AsRawSocket for UdpBuilder
[src]

fn as_raw_socket(&self) -> SOCKET

Extracts the underlying raw socket from this object.