Infinity.CommunicationObject¶
- Implementations:
Methods¶
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- class Infinity.CommunicationObject¶
- Bases:
- Structure:
Infinity.CommunicationObject
is an opaque data type. You should only access it via the public API functions.- enqueued(conn, node)¶
- Parameters:
conn (
Infinity.XmlConnection
) – AInfinity.XmlConnection
.node (
libxml2.NodePtr
) – The XML data.
This function is called, when an XML message scheduled to be sent via
Infinity.CommunicationGroup.send_message
() orInfinity.CommunicationGroup.send_group_message
() cannot be cancelled anymore, because it was already passed to conn.
- received(conn, node)¶
- Parameters:
conn (
Infinity.XmlConnection
) – TheInfinity.XmlConnection
data was received from.node (
libxml2.NodePtr
) – The received data.
- Returns:
Infinity.CommunicationScope.GROUP
if the message is allowed to be forwarded,Infinity.CommunicationScope.PTP
if not.- Return type:
This function is called when a
Infinity.CommunicationManager
received data from connection belonging to a group whose communication object is self. This function should process the incoming data. If it could not process it, then it should set error.It should return
Infinity.CommunicationScope.GROUP
if the message is allowed to be forwarded to other group members. Since recipients of forwarded messages don’t see the original sender (but just the forwarding host), forwarding arbitrary messages could lead to a security problem in the worst case.For example, if, in central mode, a client sends an (invalid) <add-node> request to the whole (InfDirectory) group, and the server forwarded this to all clients, those clients would try to create a new node although the server rejected the request. In decentral mode, this is not a problem since all clients see where the message comes from, and can themselves reject all messages not coming from the server.
- sent(conn, node)¶
- Parameters:
conn (
Infinity.XmlConnection
) – AInfinity.XmlConnection
.node (
libxml2.NodePtr
) – The sent data.
This function is called when a XML message sent via
Infinity.CommunicationGroup.send_message
() orInfinity.CommunicationGroup.send_group_message
() has actually been sent out.
- do_enqueued(conn, node) virtual¶
- Parameters:
conn (
Infinity.XmlConnection
) – AInfinity.XmlConnection
.node (
libxml2.NodePtr
) – The XML data.
This function is called, when an XML message scheduled to be sent via
Infinity.CommunicationGroup.send_message
() orInfinity.CommunicationGroup.send_group_message
() cannot be cancelled anymore, because it was already passed to conn.
- do_received(conn, node) virtual¶
- Parameters:
conn (
Infinity.XmlConnection
) – TheInfinity.XmlConnection
data was received from.node (
libxml2.NodePtr
) – The received data.
- Returns:
Infinity.CommunicationScope.GROUP
if the message is allowed to be forwarded,Infinity.CommunicationScope.PTP
if not.- Return type:
This function is called when a
Infinity.CommunicationManager
received data from connection belonging to a group whose communication object is object. This function should process the incoming data. If it could not process it, then it should set error.It should return
Infinity.CommunicationScope.GROUP
if the message is allowed to be forwarded to other group members. Since recipients of forwarded messages don’t see the original sender (but just the forwarding host), forwarding arbitrary messages could lead to a security problem in the worst case.For example, if, in central mode, a client sends an (invalid) <add-node> request to the whole (InfDirectory) group, and the server forwarded this to all clients, those clients would try to create a new node although the server rejected the request. In decentral mode, this is not a problem since all clients see where the message comes from, and can themselves reject all messages not coming from the server.
- do_sent(conn, node) virtual¶
- Parameters:
conn (
Infinity.XmlConnection
) – AInfinity.XmlConnection
.node (
libxml2.NodePtr
) – The sent data.
This function is called when a XML message sent via
Infinity.CommunicationGroup.send_message
() orInfinity.CommunicationGroup.send_group_message
() has actually been sent out.