pub unsafe extern "C" fn dc_iostream_set_timeout(
iostream: *mut dc_iostream_t,
timeout: c_int,
) -> dc_status_t
Expand description
Set the read timeout.
There are three distinct modes available:
-
Blocking (timeout < 0):
The read operation is blocked until all the requested bytes have been received. If the requested number of bytes does not arrive, the operation will block forever.
-
Non-blocking (timeout == 0):
The read operation returns immediately with the bytes that have already been received, even if no bytes have been received.
-
Timeout (timeout > 0):
The read operation is blocked until all the requested bytes have been received. If the requested number of bytes does not arrive within the specified amount of time, the operation will return with the bytes that have already been received.
@param[in] iostream A valid I/O stream. @param[in] timeout The timeout in milliseconds. @returns #DC_STATUS_SUCCESS on success, or another #dc_status_t code on failure.