Function rustix::net::recvfrom

source ·
pub fn recvfrom<Fd: AsFd>(
    fd: Fd,
    buf: &mut [u8],
    flags: RecvFlags,
) -> Result<(usize, Option<SocketAddrAny>)>
Expand description

recvfrom(fd, buf, flags, addr, len)—Reads data from a socket and returns the sender address.

This takes a &mut [u8] which Rust requires to contain initialized memory. To use an uninitialized buffer, use recvfrom_uninit.

§References