Infinity.CommunicationMethod

g GObject.GInterface GObject.GInterface Infinity.CommunicationMethod Infinity.CommunicationMethod GObject.GInterface->Infinity.CommunicationMethod

Implementations:

Infinity.CommunicationCentralMethod

Methods

add_member (connection)

cancel_messages (connection)

enqueued (connection, xml)

is_member (connection)

received (connection, xml)

remove_member (connection)

send_all (xml)

send_single (connection, xml)

sent (connection, xml)

Virtual Methods

do_add_member (connection)

do_cancel_messages (connection)

do_enqueued (connection, xml)

do_is_member (connection)

do_received (connection, xml)

do_remove_member (connection)

do_send_all (xml)

do_send_single (connection, xml)

do_sent (connection, xml)

Properties

None

Signals

Name

Short Description

add-member

This signal is emitted whenever a new connection has been added to the group on the network this method handles.

remove-member

This signal is emitted whenever a connection has been removed from the group on the network this method handles.

Fields

None

Class Details

class Infinity.CommunicationMethod
Bases:

GObject.GInterface

Structure:

Infinity.CommunicationMethodInterface

Infinity.CommunicationMethod is an opaque data type. You should only access it via the public API functions.

add_member(connection)
Parameters:

connection (Infinity.XmlConnection) – The Infinity.XmlConnection to add.

Adds a new connection to the group. The network of connection must match the network the method is handling, and connection must not already be a member of the group (see Infinity.CommunicationMethod.is_member()).

cancel_messages(connection)
Parameters:

connection (Infinity.XmlConnection) – A Infinity.XmlConnection that is a group member.

This function stops all messages to be sent to connection that have not yet been sent.

enqueued(connection, xml)
Parameters:

This function is called by the Infinity.CommunicationRegistry if data has been enqueued on registered connections (see Infinity.CommunicationRegistry.register()).

is_member(connection)
Parameters:

connection (Infinity.XmlConnection) – A Infinity.XmlConnection.

Returns:

Whether connection is a member of the group.

Return type:

bool

Returns whether connection was added to the group via Infinity.CommunicationMethod.add_member().

received(connection, xml)
Parameters:
Returns:

The scope of the message.

Return type:

Infinity.CommunicationScope

This function is called by the Infinity.CommunicationRegistry if data has been received on registered connections (see Infinity.CommunicationRegistry.register()).

This function returns the scope of the message. If the scope is Infinity.CommunicationScope.GROUP then the registry relays the message to other connections on different networks (if any).

remove_member(connection)
Parameters:

connection (Infinity.XmlConnection) – The Infinity.XmlConnection to remove.

Removes a connection from the group. connection needs to be a member of the group (see Infinity.CommunicationMethod.is_member()).

send_all(xml)
Parameters:

xml (libxml2.NodePtr) – The message to send.

Sends an XML message to all group members on this network. This function takes ownership of xml.

send_single(connection, xml)
Parameters:

Sends an XML message to connection. This function takes ownership of xml.

sent(connection, xml)
Parameters:

This function is called by the Infinity.CommunicationRegistry if data has been sent on registered connections (see Infinity.CommunicationRegistry.register()).

do_add_member(connection) virtual
Parameters:

connection (Infinity.XmlConnection) – The Infinity.XmlConnection to add.

Adds a new connection to the group. The network of connection must match the network the method is handling, and connection must not already be a member of the group (see Infinity.CommunicationMethod.is_member()).

do_cancel_messages(connection) virtual
Parameters:

connection (Infinity.XmlConnection) – A Infinity.XmlConnection that is a group member.

This function stops all messages to be sent to connection that have not yet been sent.

do_enqueued(connection, xml) virtual
Parameters:

This function is called by the Infinity.CommunicationRegistry if data has been enqueued on registered connections (see Infinity.CommunicationRegistry.register()).

do_is_member(connection) virtual
Parameters:

connection (Infinity.XmlConnection) – A Infinity.XmlConnection.

Returns:

Whether connection is a member of the group.

Return type:

bool

Returns whether connection was added to the group via Infinity.CommunicationMethod.add_member().

do_received(connection, xml) virtual
Parameters:
Returns:

The scope of the message.

Return type:

Infinity.CommunicationScope

This function is called by the Infinity.CommunicationRegistry if data has been received on registered connections (see Infinity.CommunicationRegistry.register()).

This function returns the scope of the message. If the scope is Infinity.CommunicationScope.GROUP then the registry relays the message to other connections on different networks (if any).

do_remove_member(connection) virtual
Parameters:

connection (Infinity.XmlConnection) – The Infinity.XmlConnection to remove.

Removes a connection from the group. connection needs to be a member of the group (see Infinity.CommunicationMethod.is_member()).

do_send_all(xml) virtual
Parameters:

xml (libxml2.NodePtr) – The message to send.

Sends an XML message to all group members on this network. This function takes ownership of xml.

do_send_single(connection, xml) virtual
Parameters:

Sends an XML message to connection. This function takes ownership of xml.

do_sent(connection, xml) virtual
Parameters:

This function is called by the Infinity.CommunicationRegistry if data has been sent on registered connections (see Infinity.CommunicationRegistry.register()).

Signal Details

Infinity.CommunicationMethod.signals.add_member(communication_method, connection)
Signal Name:

add-member

Flags:

RUN_LAST

Parameters:

This signal is emitted whenever a new connection has been added to the group on the network this method handles.

Infinity.CommunicationMethod.signals.remove_member(communication_method, connection)
Signal Name:

remove-member

Flags:

RUN_LAST

Parameters:

This signal is emitted whenever a connection has been removed from the group on the network this method handles.