Infinity.Keepalive¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
enabled |
r/w |
Whether sending keep-alive probes is enabled or not. |
|
interval |
r/w |
Time in seconds between keep-alive probes. |
|
mask |
r/w |
Which of the following settings are enabled. If a setting is disabled, then the system default is taken. |
|
time |
r/w |
Time in seconds after which to send keep-alive probes. |
Methods¶
|
|
|
|
|
|
|
Details¶
- class Infinity.Keepalive¶
This structure contains the settings to configure keep-alive on TCP connections.
- apply(socket, current_mask)¶
- Parameters:
socket (
int
) – The socket to which to apply the keepalive settings.current_mask (
Infinity.KeepaliveMask
) – The mask of currently applied keepalive settings on the socket, orInfinity.KeepaliveMask.ALL
if unknown.
- Raises:
- Returns:
- Return type:
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:
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 withInfinity.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.