![]() |
![]() |
![]() |
libinfinity-0.4 Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#include <libinfinity/communication/inf-communication-registry.h> InfCommunicationRegistry; InfCommunicationRegistryClass; void inf_communication_registry_register (InfCommunicationRegistry *registry, InfCommunicationGroup *group, InfCommunicationMethod *method, InfXmlConnection *connection); void inf_communication_registry_unregister (InfCommunicationRegistry *registry, InfCommunicationGroup *group, InfXmlConnection *connection); gboolean inf_communication_registry_is_registered (InfCommunicationRegistry *registry, InfCommunicationGroup *group, InfXmlConnection *connection); void inf_communication_registry_send (InfCommunicationRegistry *registry, InfCommunicationGroup *group, InfXmlConnection *connection, xmlNodePtr xml); void inf_communication_registry_cancel_messages (InfCommunicationRegistry *registry, InfCommunicationGroup *group, InfXmlConnection *connection);
InfCommunicationRegistry provides a way for InfCommunicationMethod
implementations to share connections with other groups. Before using a
connection, call inf_communication_registry_register()
. Then, messages can
be sent to the group via inf_communication_registry_send()
.
The InfCommunicationRegistry calls inf_communication_method_received()
on your method when it received a message for the group,
inf_communication_method_enqueued()
when sending the message cannot be
cancelled anymore via inf_communication_registry_cancel_messages()
and
inf_communication_method_sent()
when the message has been sent.
typedef struct _InfCommunicationRegistry InfCommunicationRegistry;
InfCommunicationRegistry is an opaque data type. You should only access it via the public API functions.
typedef struct { } InfCommunicationRegistryClass;
This structure does not contain any public fields.
void inf_communication_registry_register (InfCommunicationRegistry *registry, InfCommunicationGroup *group, InfCommunicationMethod *method, InfXmlConnection *connection);
Registers connection with group
. This allows sending messages to
connection
via inf_communication_registry_send()
. For received messages,
inf_communication_method_received()
is called on method
.
connection
must have status INF_XML_CONNECTION_OPEN
.
|
A InfCommunicationRegistry. |
|
The group for which to register a connection. |
|
The InfCommunicationMethod used. |
|
The connection to register. |
void inf_communication_registry_unregister (InfCommunicationRegistry *registry, InfCommunicationGroup *group, InfXmlConnection *connection);
Unregisters connection
from group
. Incoming messages are no longer
reported to group's method, and inf_communication_registry_send()
can
no longer be called for connection
.
|
A InfCommunicationRegistry. |
|
The group for which to unregister a connection. |
|
The connection to unregister. |
gboolean inf_communication_registry_is_registered (InfCommunicationRegistry *registry, InfCommunicationGroup *group, InfXmlConnection *connection);
Returns whether connection
has been registered for group
with
inf_communication_registry_register()
.
|
A InfCommunicationRegistry. |
|
The group for which to check whether connection is registered.
|
|
The connection to check for registration. |
Returns : |
TRUE if connection has been registered, or FALSE otherwise.
|
void inf_communication_registry_send (InfCommunicationRegistry *registry, InfCommunicationGroup *group, InfXmlConnection *connection, xmlNodePtr xml);
Sends an XML message to connection
. connection
must have been registered
with inf_communication_registry_register()
before. If the message has been
sent, inf_communication_method_sent()
is called on the method the
connection was registered with. inf_communication_method_enqueued()
is
called when sending the message can no longer be cancelled via
inf_communication_registry_cancel_messages()
.
This function takes ownership of xml
.
|
A InfCommunicationRegistry. |
|
The group for which to send the message InfCommunicationGroup. |
|
A registered InfXmlConnection. |
|
The message to send. |
void inf_communication_registry_cancel_messages (InfCommunicationRegistry *registry, InfCommunicationGroup *group, InfXmlConnection *connection);
Stops all messages scheduled to be sent to connection
in group
from being
sent.
|
A InfCommunicationRegistry. |
|
The group for which to cancel messages. |
|
A registered InfXmlConnection. |