Socket.setTimeout

Sets the time in seconds after which I/O operations on socket will time out if they have not yet completed.

On a blocking socket, this means that any blocking atk.Socket operation will time out after timeout seconds of inactivity, returning G_IO_ERROR_TIMED_OUT.

On a non-blocking socket, calls to Socket.conditionWait will also fail with G_IO_ERROR_TIMED_OUT after the given time. Sources created with Socket.createSource will trigger after timeout seconds of inactivity, with the requested condition set, at which point calling Socket.receive, Socket.send, Socket.checkConnectResult, 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.

class Socket
void
setTimeout
(
uint timeout
)

Parameters

timeout uint

the timeout for socket, in seconds, or 0 for none

Meta

Since

2.26