pub unsafe extern "C" fn dc_iostream_poll(
iostream: *mut dc_iostream_t,
timeout: c_int,
) -> dc_status_tExpand description
Poll the I/O stream for available data.
There are three distinct modes available:
-
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.
-
Non-blocking (timeout == 0):
The poll operation returns immediately, even if no bytes have been received.
-
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.