Infinity.CommunicationMethod¶
- Implementations:
Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
None
Signals¶
Name |
Short Description |
---|---|
This signal is emitted whenever a new connection has been added to the group on the network this method handles. |
|
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:
- Structure:
Infinity.CommunicationMethod
is an opaque data type. You should only access it via the public API functions.- add_member(connection)¶
- Parameters:
connection (
Infinity.XmlConnection
) – TheInfinity.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
) – AInfinity.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:
connection (
Infinity.XmlConnection
) – AInfinity.XmlConnection
.xml (
libxml2.NodePtr
) – The enqueued message.
This function is called by the
Infinity.CommunicationRegistry
if data has been enqueued on registered connections (seeInfinity.CommunicationRegistry.register
()).
- is_member(connection)¶
- Parameters:
connection (
Infinity.XmlConnection
) – AInfinity.XmlConnection
.- Returns:
Whether connection is a member of the group.
- Return type:
Returns whether connection was added to the group via
Infinity.CommunicationMethod.add_member
().
- received(connection, xml)¶
- Parameters:
connection (
Infinity.XmlConnection
) – AInfinity.XmlConnection
that is a group member.xml (
libxml2.NodePtr
) – The received message.
- Returns:
The scope of the message.
- Return type:
This function is called by the
Infinity.CommunicationRegistry
if data has been received on registered connections (seeInfinity.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
) – TheInfinity.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:
connection (
Infinity.XmlConnection
) – AInfinity.XmlConnection
that is a group member.xml (
libxml2.NodePtr
) – The message to send.
Sends an XML message to connection. This function takes ownership of xml.
- sent(connection, xml)¶
- Parameters:
connection (
Infinity.XmlConnection
) – AInfinity.XmlConnection
.xml (
libxml2.NodePtr
) – The sent message.
This function is called by the
Infinity.CommunicationRegistry
if data has been sent on registered connections (seeInfinity.CommunicationRegistry.register
()).
- do_add_member(connection) virtual¶
- Parameters:
connection (
Infinity.XmlConnection
) – TheInfinity.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
) – AInfinity.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:
connection (
Infinity.XmlConnection
) – AInfinity.XmlConnection
.xml (
libxml2.NodePtr
) – The enqueued message.
This function is called by the
Infinity.CommunicationRegistry
if data has been enqueued on registered connections (seeInfinity.CommunicationRegistry.register
()).
- do_is_member(connection) virtual¶
- Parameters:
connection (
Infinity.XmlConnection
) – AInfinity.XmlConnection
.- Returns:
Whether connection is a member of the group.
- Return type:
Returns whether connection was added to the group via
Infinity.CommunicationMethod.add_member
().
- do_received(connection, xml) virtual¶
- Parameters:
connection (
Infinity.XmlConnection
) – AInfinity.XmlConnection
that is a group member.xml (
libxml2.NodePtr
) – The received message.
- Returns:
The scope of the message.
- Return type:
This function is called by the
Infinity.CommunicationRegistry
if data has been received on registered connections (seeInfinity.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
) – TheInfinity.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:
connection (
Infinity.XmlConnection
) – AInfinity.XmlConnection
that is a group member.xml (
libxml2.NodePtr
) – The message to send.
Sends an XML message to connection. This function takes ownership of xml.
- do_sent(connection, xml) virtual¶
- Parameters:
connection (
Infinity.XmlConnection
) – AInfinity.XmlConnection
.xml (
libxml2.NodePtr
) – The sent message.
This function is called by the
Infinity.CommunicationRegistry
if data has been sent on registered connections (seeInfinity.CommunicationRegistry.register
()).
Signal Details¶
- Infinity.CommunicationMethod.signals.add_member(communication_method, connection)¶
- Signal Name:
add-member
- Flags:
- Parameters:
communication_method (
Infinity.CommunicationMethod
) – The object which received the signalconnection (
Infinity.XmlConnection
) – TheInfinity.XmlConnection
that was added.
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:
- Parameters:
communication_method (
Infinity.CommunicationMethod
) – The object which received the signalconnection (
Infinity.XmlConnection
) – TheInfinity.XmlConnection
that was removed.
This signal is emitted whenever a connection has been removed from the group on the network this method handles.