Trait cobalt::Socket [] [src]

pub trait Socket: Debug {
    fn new<T: ToSocketAddrs>(_: T, _: usize) -> Result<Self, Error>
    where
        Self: Sized
; fn try_recv(&mut self) -> Result<(SocketAddr, Vec<u8>), TryRecvError>; fn send_to(&mut self, data: &[u8], addr: SocketAddr) -> Result<usize, Error>; fn local_addr(&self) -> Result<SocketAddr, Error>; }

Trait describing a non-blocking low latency socket.

Required Methods

Method that tries to bind a new socket at the specified address.

Method that attempts to return a incoming packet on this socket without blocking.

Method sending data on the socket to the given address. On success, returns the number of bytes written.

Method returning the address of the actual, underlying socket.

Implementors