Function nrfxlib_sys::nrf_sendto[][src]

pub unsafe extern "C" fn nrf_sendto(
    sock: c_int,
    p_buff: *const c_void,
    nbytes: size_t,
    flags: c_int,
    p_servaddr: *const c_void,
    addrlen: nrf_socklen_t
) -> ssize_t
Expand description

Function for sending datagram through a socket.

s By default, this function will block if the lower layers are not able to process the packet, unless the NRF_O_NONBLOCK socket option has been set, OR NRF_MSG_DONTWAIT is passed as a flag. In that case, the method will return immediately.

  • sock - The socket to write data to.
  • p_buff - Buffer containing the data to send.
  • nbytes - Size of data contained in p_buff.
  • flags - Flags to control send behavior.
  • p_servaddr - The address of the server to send to.
  • addrlen - The size of the p_servaddr argument.

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