Infinoted.Plugin

Fields

Name

Type

Access

Description

connection_info_size

int

r/w

The size of the plugin’s connection info structure. For each plugin instance, this amount of memory will be allocated for each connection of the server. The plugin can use it to store connection-specific data. This field can be 0.

description

str

r/w

A human-readable description of what the plugin does.

info_size

int

r/w

The size of the plugin instance structure. When the plugin is instantiated, this amount of memory will be allocated for the plugin instance. This field must be different from 0.

name

str

r/w

The name of the plugin. The filename of the shared object should be libinfinoted-plugin-<name>.

on_connection_added

object

r

Function called when there is a new connection to the server. It is also called for all existing connections at the time the plugin is loaded.

on_connection_removed

object

r

Function called when a client connection has been dropped. It is also called for all existing connections right before the plugin is unloaded.

on_deinitialize

object

r

Function called when the plugin is unloaded. Should clean up all resources the plugin has allocated.

on_info_initialize

object

r

Function called after the plugin has been instantiated. It should initialize all fields of the plugin instance to a sane default value.

on_initialize

object

r

Function called to initialize the plugin. The function can return False and set the error parameter to prevent the plugin from being used. The server will not be started in this case. Even if this function returns False, on_deinitialize will be called on the plugin to clean up partly constructed plugin data by this function.

on_session_added

object

r

Function called when a new session has become active on the server. It is also called for all existing sessions at the time the plugin is loaded.

on_session_removed

object

r

Function called when a session has become inactive and the server is freeing resources allocated to it. It is also called for all existing sessions right before the plugin is unloaded.

options

Infinoted.ParameterInfo

r/w

A 0-terminated list of plugin parameters. The parameters are provided to the plugin via the infinoted configuration file or the command line. The last element of the list must have the name field set to None.

session_info_size

int

r/w

The size of the plugin’s session info structure. For each plugin instance, this amount of memory will be allocated for each session that is currently active on the server. The plugin can use it to store session-specific data. This field can be 0.

session_type

str

r/w

If non-None, specifies the session type handled by the plugin. Only for sessions of this type or a derived type a session info structure is allocated. The on_session_added and on_session_removed callbacks are always made, independent of this field.

Methods

None

Details

class Infinoted.Plugin

Declares a Infinoted.Plugin. If an instance of this structure is called INFINOTED_PLUGIN and exported from a shared object, it can be loaded as a plugin by infinoted.