Top | ![]() |
![]() |
![]() |
![]() |
InfCommunicationManager manages multiple communication sessions represented by InfCommunicationGroup. A InfCommunicationGroup provides an easy way to send messages between group members, possibly sharing connections with other groups handled by the same InfCommunicationManager.
InfCommunicationManager *
inf_communication_manager_new (void
);
Creates a new InfCommunicationManager.
[constructor]
InfCommunicationHostedGroup * inf_communication_manager_open_group (InfCommunicationManager *manager
,const gchar *group_name
,const gchar * const*methods
);
Opens a new communication group published by the local host. group_name
is an identifier for the group via which other hosts can join the group
using inf_communication_manager_join_group()
. It needs to be unique among
all groups opened by the local host.
methods
specifies what communication methods the group should use, in
order of priority. If a method is not supported for a given network, then
the next one in the array is tried. If none is supported, then the
"central" method will be used, which is guaranteed to be supported for
all networks.
manager |
||
group_name |
A name for the new group. |
|
methods |
Methods to support, or
|
[allow-none][array zero-terminated=1] |
A InfCommunicationHostedGroup. Free with
g_object_unref()
to leave the group.
[transfer full]
InfCommunicationJoinedGroup * inf_communication_manager_join_group (InfCommunicationManager *manager
,const gchar *group_name
,InfXmlConnection *publisher_conn
,const gchar *method
);
Joins a communication group published by a remote host. publisher_conn
needs to be a to the publishing host with status INF_XML_CONNECTION_OPEN
or INF_XML_CONNECTION_OPENING
. group_name
specifies the name of the group
to join.
method
specifies the communication method to use. It must match the
communication method the publisher has chosen for publisher_conn
's network
(see inf_communication_group_get_method_for_network()
). The function
returns NULL
if method
is not supported (which means
inf_communication_manager_get_factory_for()
for publisher_conn
's network
and method
returns NULL
).
manager |
||
group_name |
The group to join. |
|
publisher_conn |
A InfXmlConnection to the publishing host. |
|
method |
The communication method to use. |
A new InfCommunicationJoinedGroup,
or NULL
. Free with g_object_unref()
to leave the group.
[transfer full][allow-none]
void inf_communication_manager_add_factory (InfCommunicationManager *manager
,InfCommunicationFactory *factory
);
Adds a new InfCommunicationFactory to manager
. This makes manager
support all method/network combinations that factory
supports. If multiple
added factories support the same combination, the one which was added first
will be used to instantiate the InfCommunicationMethod.
InfCommunicationFactory * inf_communication_manager_get_factory_for (InfCommunicationManager *manager
,const gchar *network
,const gchar *method_name
);
Returns the InfCommunicationFactory that manager
will use to instantiate
a InfCommunicationMethod for method_name
on network
, or NULL
if the
network/method combination is not supported.
struct InfCommunicationManager;
InfCommunicationManager is an opaque data type. You should only access it via the public API functions.