Infinity.CommunicationObject

g GObject.GInterface GObject.GInterface Infinity.CommunicationObject Infinity.CommunicationObject GObject.GInterface->Infinity.CommunicationObject

Implementations:

Infinity.Session

Methods

enqueued (conn, node)

received (conn, node)

sent (conn, node)

Virtual Methods

do_enqueued (conn, node)

do_received (conn, node)

do_sent (conn, node)

Properties

None

Signals

None

Fields

None

Class Details

class Infinity.CommunicationObject
Bases:

GObject.GInterface

Structure:

Infinity.CommunicationObjectInterface

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

enqueued(conn, node)
Parameters:

This function is called, when an XML message scheduled to be sent via Infinity.CommunicationGroup.send_message() or Infinity.CommunicationGroup.send_group_message() cannot be cancelled anymore, because it was already passed to conn.

received(conn, node)
Parameters:
Returns:

Infinity.CommunicationScope.GROUP if the message is allowed to be forwarded, Infinity.CommunicationScope.PTP if not.

Return type:

Infinity.CommunicationScope

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:

This function is called when a XML message sent via Infinity.CommunicationGroup.send_message() or Infinity.CommunicationGroup.send_group_message() has actually been sent out.

do_enqueued(conn, node) virtual
Parameters:

This function is called, when an XML message scheduled to be sent via Infinity.CommunicationGroup.send_message() or Infinity.CommunicationGroup.send_group_message() cannot be cancelled anymore, because it was already passed to conn.

do_received(conn, node) virtual
Parameters:
Returns:

Infinity.CommunicationScope.GROUP if the message is allowed to be forwarded, Infinity.CommunicationScope.PTP if not.

Return type:

Infinity.CommunicationScope

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:

This function is called when a XML message sent via Infinity.CommunicationGroup.send_message() or Infinity.CommunicationGroup.send_group_message() has actually been sent out.