dc_iostream_poll

Function dc_iostream_poll 

Source
pub unsafe extern "C" fn dc_iostream_poll(
    iostream: *mut dc_iostream_t,
    timeout: c_int,
) -> dc_status_t
Expand description

Poll the I/O stream for available data.

There are three distinct modes available:

  1. Blocking (timeout < 0):

    The poll operation is blocked until one or more bytes have been received. If no bytes are received, the operation will block forever.

  2. Non-blocking (timeout == 0):

    The poll operation returns immediately, even if no bytes have been received.

  3. Timeout (timeout > 0):

    The poll operation is blocked until one or more bytes have been received. If no bytes are received within the specified amount of time, the operation will return with a timeout.

@param[in] iostream A valid I/O stream. @param[in] timeout The timeout in milliseconds. @returns #DC_STATUS_SUCCESS on success, #DC_STATUS_TIMEOUT on timeout, or another #dc_status_t code on failure.