condition_timed_wait


Description:

public bool condition_timed_wait (IOCondition condition, int64 timeout, Cancellable? cancellable = null) throws Error

Waits for up to timeout microseconds for condition to become true on this.

If the condition is met, true is returned.

If cancellable is cancelled before the condition is met, or if timeout (or the socket's timeout) is reached before the condition is met, then false is returned and throws, if non- null, is set to the appropriate value ( g_io_error_cancelled or g_io_error_timed_out).

If you don't want a timeout, use condition_wait. (Alternatively, you can pass -1 for timeout.)

Note that although timeout is in microseconds for consistency with other GLib APIs, this function actually only has millisecond resolution, and the behavior is undefined if timeout is not an exact number of milliseconds.

Parameters:

this

a Socket

condition

a IOCondition mask to wait for

timeout

the maximum time (in microseconds) to wait, or -1

cancellable

a Cancellable, or null

Returns:

true if the condition was met, false otherwise