Method lrs::socket::Socket::recv_from

Receives a message on a connection-less socket.

Syntax

impl Socket {
    fn recv_from(&self, buf: &mut [u8], addr_buf: &'a mut [u8], flags: MsgFlags) -> Result<(usize, Option<&'a mut SockAddr>), Errno>
}

Arguments

NameDescription
buf

The buffer in which the message will be stored.

addr_buf

The buffer in which the address of the sender will be stored.

flags

Flags that can change the behavior of the operation.

Return value

Returns the number of bytes received and the address of the sender.

See also