Infinity.CommunicationManager

g GObject.Object GObject.Object Infinity.CommunicationManager Infinity.CommunicationManager GObject.Object->Infinity.CommunicationManager

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add_factory (factory)

get_factory_for (network, method_name)

join_group (group_name, publisher_conn, method)

open_group (group_name, methods)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Infinity.CommunicationManager(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Infinity.CommunicationManagerClass

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

classmethod new()
Returns:

A new Infinity.CommunicationManager.

Return type:

Infinity.CommunicationManager

Creates a new Infinity.CommunicationManager.

add_factory(factory)
Parameters:

factory (Infinity.CommunicationFactory) – The Infinity.CommunicationFactory to add.

Adds a new Infinity.CommunicationFactory to self. This makes self 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 Infinity.CommunicationMethod.

get_factory_for(network, method_name)
Parameters:
  • network (str) – A network identifier.

  • method_name (str) – A method name.

Returns:

A Infinity.CommunicationFactory, or None.

Return type:

Infinity.CommunicationFactory or None

Returns the Infinity.CommunicationFactory that self will use to instantiate a Infinity.CommunicationMethod for method_name on network, or None if the network/method combination is not supported.

join_group(group_name, publisher_conn, method)
Parameters:
Returns:

A new Infinity.CommunicationJoinedGroup, or None. Free with GObject.Object.unref() to leave the group.

Return type:

Infinity.CommunicationJoinedGroup or None

Joins a communication group published by a remote host. publisher_conn needs to be a to the publishing host with status Infinity.XmlConnectionStatus.OPEN or Infinity.XmlConnectionStatus.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 Infinity.CommunicationGroup.get_method_for_network()). The function returns None if method is not supported (which means Infinity.CommunicationManager.get_factory_for() for publisher_conn's network and method returns None).

open_group(group_name, methods)
Parameters:
  • group_name (str) – A name for the new group.

  • methods ([str] or None) – Methods to support, or None.

Returns:

A Infinity.CommunicationHostedGroup. Free with GObject.Object.unref() to leave the group.

Return type:

Infinity.CommunicationHostedGroup

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 Infinity.CommunicationManager.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.