devela::_dep::rustix::net

Function recvfrom

pub fn recvfrom<Fd>(
    fd: Fd,
    buf: &mut [u8],
    flags: RecvFlags,
) -> Result<(usize, Option<SocketAddrAny>), Errno> 
where Fd: AsFd,
Available on crate feature dep_rustix only.
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