Top | ![]() |
![]() |
![]() |
![]() |
InfCommunicationObject is implemented by InfAdoptedSession, InfChatSession, InfSession, InfcBrowser, InfcSessionProxy, InfdDirectory and InfdSessionProxy.
A InfCommunicationObject is the destination of network messages sent
through the InfCommunicationManager. Each InfCommunicationGroup is
associated with InfCommunicationObject. Requests received by that group
are reported to the InfCommunicationObject by calling
inf_communication_object_received()
on it. Messages sent to a member of
that group (via inf_communication_group_send_message()
) are also reported
by calling inf_communication_object_sent()
.
InfCommunicationScope inf_communication_object_received (InfCommunicationObject *object
,InfXmlConnection *conn
,xmlNodePtr node
);
This function is called when a InfCommunicationManager 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 INF_COMMUNICATION_SCOPE_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.
INF_COMMUNICATION_SCOPE_GROUP
if the message is allowed to
be forwarded, INF_COMMUNICATION_SCOPE_PTP
if not.
void inf_communication_object_enqueued (InfCommunicationObject *object
,InfXmlConnection *conn
,xmlNodePtr node
);
This function is called, when an XML message scheduled to be sent via
inf_communication_group_send_message()
or
inf_communication_group_send_group_message()
cannot be cancelled anymore,
because it was already passed to conn
.
void inf_communication_object_sent (InfCommunicationObject *object
,InfXmlConnection *conn
,xmlNodePtr node
);
This function is called when a XML message sent via
inf_communication_group_send_message()
or
inf_communication_group_send_group_message()
has actually been sent out.
typedef struct _InfCommunicationObject InfCommunicationObject;
InfCommunicationObject is an opaque data type. You should only access it via the public API functions.
struct InfCommunicationObjectInterface { InfCommunicationScope (*received)(InfCommunicationObject* object, InfXmlConnection* conn, xmlNodePtr node); void (*enqueued)(InfCommunicationObject* object, InfXmlConnection* conn, xmlNodePtr node); void (*sent)(InfCommunicationObject* object, InfXmlConnection* conn, xmlNodePtr node); };
The virtual methods of InfCommunicationObject. These are called by the InfCommunicationMethod when appropriate.
Called when a message for the group related to this InfCommunicationObject was received. |
||
Called when a message to be sent to another group member has
been enqueued, which means sending it can no longer be cancelled via
|
||
Called when a message has been sent to another group member of the group related no this InfCommunicationObject. |