Gio.Socket.prototype.condition_check

function condition_check(condition: GLib.IOCondition): GLib.IOCondition {
    // Gjs wrapper for g_socket_condition_check()
}
  

Checks on the readiness of socket to perform operations. The operations specified in condition are checked for and masked against the currently-satisfied conditions on socket. The result is returned.

Note that on Windows, it is possible for an operation to return Gio.IOErrorEnum.would_block even immediately after Gio.Socket.prototype.condition_check has claimed that the socket is ready for writing. Rather than calling Gio.Socket.prototype.condition_check and then writing to the socket if it succeeds, it is generally better to simply try writing to the socket right away, and try again later if the initial attempt returns Gio.IOErrorEnum.would_block.

It is meaningless to specify GLib.IOCondition.err or GLib.IOCondition.hup in condition; these conditions will always be set in the output if they are true.

This call never blocks.

Since 2.22

condition

a GLib.IOCondition mask to check

Returns

the @GIOCondition mask of the current state