Struct smoltcp::socket::UdpSocket [] [src]

pub struct UdpSocket<'a, 'b: 'a> { /* fields omitted */ }

An User Datagram Protocol socket.

An UDP socket is bound to a specific endpoint, and owns transmit and receive packet buffers.

Methods

impl<'a, 'b> UdpSocket<'a, 'b>
[src]

Create an UDP socket with the given buffers.

Enqueue a packet to be sent to a given remote endpoint, and return a pointer to its payload.

This function returns Err(Error::Exhausted) if the size is greater than what the transmit buffer can accomodate.

Enqueue a packet to be sent to a given remote endpoint, and fill it from a slice.

See also send.

Dequeue a packet received from a remote endpoint, and return the endpoint as well as a pointer to the payload.

This function returns Err(Error::Exhausted) if the receive buffer is empty.

Dequeue a packet received from a remote endpoint, and return the endpoint as well as copy the payload into the given slice.

This function returns Err(Error::Exhausted) if the received packet has payload larger than the provided slice. See also recv.