Function nrfxlib_sys::nrf_select[][src]

pub unsafe extern "C" fn nrf_select(
    nfds: c_int,
    p_readset: *mut nrf_fd_set,
    p_writeset: *mut nrf_fd_set,
    p_exceptset: *mut nrf_fd_set,
    p_timeout: *const nrf_timeval
) -> c_int
Expand description

Function for waiting for read, write, or exception events on a socket.

s Wait for a set of socket descriptors to be ready for reading, writing, or having exceptions. The set of socket descriptors is configured before calling this function. This function will block until any of the descriptors in the set has any of the required events. This function is mostly useful when using NRF_O_NONBLOCK or NRF_MSG_DONTWAIT options to enable asynchronous operation.

  • nfds - The highest socket descriptor value contained in the sets.
  • p_readset - The set of descriptors for which to wait for read events. Set to NULL if not used.
  • p_writeset - The set of descriptors for which to wait for write events. Set to NULL if not used.
  • p_exceptset - The set of descriptors for which to wait for exception events. Set to NULL if not used.
  • p_timeout - The timeout to use for select call. Set to NULL if waiting forever.

Returns The number of ready descriptors contained in the descriptor sets on success, or -1 on error.