Function nrfxlib_sys::nrf_recvfrom[][src]

pub unsafe extern "C" fn nrf_recvfrom(
    sock: c_int,
    p_buff: *mut c_void,
    nbytes: size_t,
    flags: c_int,
    p_cliaddr: *mut c_void,
    p_addrlen: *mut nrf_socklen_t
) -> ssize_t

Function for receiving datagram on a socket.

s API for receiving data from a socket. By default, this function will block, unless the NRF_O_NONBLOCK socket option has been set, or NRF_MSG_DONTWAIT is passed as a flag.

  • sock - The socket to receive data from.
  • p_buff - Buffer to hold the data to be read.
  • nbytes - Number of bytes to read. Should not be larger than the size of p_buff.
  • flags - Flags to control receive behavior.
  • p_cliaddr - Socket address that will be set to the client's address.
  • p_addrlen - The size of the p_cliaddr passed. Might be modified by the function.

Returns The number of bytes that were read, or -1 on error.