set_timeout
Description:
Sets the time in seconds after which I/O operations on this will time out if they have not yet completed.
On a blocking socket, this means that any blocking Socket operation will time out after
timeout
seconds of inactivity, returning g_io_error_timed_out.
On a non-blocking socket, calls to condition_wait will also fail with
g_io_error_timed_out after the given time. Sources created with
create_source will trigger after timeout
seconds of
inactivity, with the requested condition set, at which point calling receive,
send,
check_connect_result, etc, will fail with g_io_error_timed_out.
If timeout
is 0 (the default), operations will never time out on their own.
Note that if an I/O operation is interrupted by a signal, this may cause the timeout to be reset.
Parameters:
this |
a Socket. |
timeout |
the timeout for this, in seconds, or 0 for none |