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.CommunicationMethodis an opaque data type. You should only access it via the public API functions.- 
add_member(connection)¶
- Parameters: - connection ( - Infinity.XmlConnection) – The- Infinity.XmlConnectionto 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.XmlConnectionthat 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.CommunicationRegistryif data has been enqueued on registered connections (see- Infinity.CommunicationRegistry.register()).
- connection (
 - 
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: - connection (Infinity.XmlConnection) – AInfinity.XmlConnectionthat 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.CommunicationRegistryif 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.GROUPthen the registry relays the message to other connections on different networks (if any).
- connection (
 - 
remove_member(connection)¶
- Parameters: - connection ( - Infinity.XmlConnection) – The- Infinity.XmlConnectionto 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.XmlConnectionthat is a group member.
- xml (libxml2.NodePtr) – The message to send.
 - Sends an XML message to connection. This function takes ownership of xml. 
- connection (
 - 
sent(connection, xml)¶
- Parameters: - connection (Infinity.XmlConnection) – AInfinity.XmlConnection.
- xml (libxml2.NodePtr) – The sent message.
 - This function is called by the - Infinity.CommunicationRegistryif data has been sent on registered connections (see- Infinity.CommunicationRegistry.register()).
- connection (
 - 
do_add_member(connection) virtual¶
- Parameters: - connection ( - Infinity.XmlConnection) – The- Infinity.XmlConnectionto 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.XmlConnectionthat 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.CommunicationRegistryif data has been enqueued on registered connections (see- Infinity.CommunicationRegistry.register()).
- connection (
 - 
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: - connection (Infinity.XmlConnection) – AInfinity.XmlConnectionthat 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.CommunicationRegistryif 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.GROUPthen the registry relays the message to other connections on different networks (if any).
- connection (
 - 
do_remove_member(connection) virtual¶
- Parameters: - connection ( - Infinity.XmlConnection) – The- Infinity.XmlConnectionto 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.XmlConnectionthat is a group member.
- xml (libxml2.NodePtr) – The message to send.
 - Sends an XML message to connection. This function takes ownership of xml. 
- connection (
 - 
do_sent(connection, xml) virtual¶
- Parameters: - connection (Infinity.XmlConnection) – AInfinity.XmlConnection.
- xml (libxml2.NodePtr) – The sent message.
 - This function is called by the - Infinity.CommunicationRegistryif data has been sent on registered connections (see- Infinity.CommunicationRegistry.register()).
- connection (
 
- 
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 signal
- connection (Infinity.XmlConnection) – TheInfinity.XmlConnectionthat was added.
 - This signal is emitted whenever a new connection has been added to the group on the network this method handles. 
- communication_method (
- 
Infinity.CommunicationMethod.signals.remove_member(communication_method, connection)¶
- Signal Name: - remove-member- Flags: - Parameters: - communication_method (Infinity.CommunicationMethod) – The object which received the signal
- connection (Infinity.XmlConnection) – TheInfinity.XmlConnectionthat was removed.
 - This signal is emitted whenever a connection has been removed from the group on the network this method handles. 
- communication_method (