[−][src]Trait ninat::RW
Represents an socket which can send data to and receive data from a certain address.
Required methods
fn local_addr(&self) -> Result<SocketAddrV4>
Returns the socket address that this socket was created from.
fn send_to(&self, buf: &[u8], addr: SocketAddrV4) -> Result<usize>
Sends data on the socket to the given address.
fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddrV4)>
Receives a single datagram message on the socket.
fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>
Sets the read timeout to the timeout specified.
fn set_write_timeout(&self, dur: Option<Duration>) -> Result<()>
Sets the write timeout to the timeout specified.
fn read_timeout(&self) -> Result<Option<Duration>>
Returns the read timeout of this socket.
fn write_timeout(&self) -> Result<Option<Duration>>
Returns the write timeout of this socket.