Infinity.Keepalive

Fields

Name

Type

Access

Description

enabled

bool

r/w

Whether sending keep-alive probes is enabled or not.

interval

int

r/w

Time in seconds between keep-alive probes.

mask

Infinity.KeepaliveMask

r/w

Which of the following settings are enabled. If a setting is disabled, then the system default is taken.

time

int

r/w

Time in seconds after which to send keep-alive probes.

Methods

apply (socket, current_mask)

copy ()

free ()

load_default (mask)

Details

class Infinity.Keepalive

This structure contains the settings to configure keep-alive on TCP connections.

apply(socket, current_mask)
Parameters:
Raises:

GLib.Error

Returns:

True on success or False if an error occurred.

Return type:

bool

Sets the keepalive settings of self for the socket socket. This function abstracts away the platform-dependent configuration of keepalives.

If current_mask is not Infinity.KeepaliveMask.ALL, it can help this function to not do some unneccessary system calls.

copy()
Returns:

A copy of self. Free with Infinity.Keepalive.free().

Return type:

Infinity.Keepalive

Makes a dynamically allocated copy of self. This is typically not needed, since the structure can be copied by value, but might prove useful for language bindings.

free()

Frees a Infinity.Keepalive obtained with Infinity.Keepalive.copy().

load_default(mask)
Parameters:

mask (Infinity.KeepaliveMask) – A mask that specifies which values to obtain.

This function attempts to obtain the default keepalive settings from the system. If it cannot obtain the default settings, the documented standard values for the host platform are used.

Only the values specified in mask are obtained, and other fields in self are left untouched.