Infinity.Discovery

g GObject.GInterface GObject.GInterface Infinity.Discovery Infinity.Discovery GObject.GInterface->Infinity.Discovery

Implementations:

Infinity.DiscoveryAvahi

Methods

discover (type)

discovered (info)

get_discovered (type)

info_get_service_name (info)

info_get_service_type (info)

resolve (info, complete_func, *user_data)

undiscovered (info)

Virtual Methods

do_discover (type)

do_discovered (info)

do_get_discovered (type)

do_info_get_service_name (info)

do_info_get_service_type (info)

do_resolve (info, complete_func, *user_data)

do_undiscovered (info)

Properties

None

Signals

Name

Short Description

discovered

This signal is detailed.

undiscovered

This signal is emitted if a previously discovered service is no longer available.

Fields

None

Class Details

class Infinity.Discovery
Bases:

GObject.GInterface

Structure:

Infinity.DiscoveryInterface

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

discover(type)
Parameters:

type (str) – The service type to discover.

Starts the discovery of the given service type. Whenever a service of this type is discovered, the “discovered” signal is emitted. If the service disappears, the “undiscovered” signal is emitted. This can be called more than once for the same type, but only the first call has an effect.

Note also that implementations of Infinity.Discovery might restrict the service types that can be discovered.

discovered(info)
Parameters:

info (Infinity.DiscoveryInfo) – The discovered Infinity.DiscoveryInfo.

Emits the “discovered” signal on self.

get_discovered(type)
Parameters:

type (str) – The service type of which to get discovered infos for.

Returns:

A newly allocated list that needs to be freed with g_slist_free().

Return type:

[Infinity.DiscoveryInfo]

Returns a list of discovered Infinity.DiscoveryInfo for the given type.

info_get_service_name(info)
Parameters:

info (Infinity.DiscoveryInfo) – A Infinity.DiscoveryInfo discovered by self.

Returns:

A newly allocated string. Free with GLib.free().

Return type:

str

Returns the service name of the discovered info.

info_get_service_type(info)
Parameters:

info (Infinity.DiscoveryInfo) – A Infinity.DiscoveryInfo discovered by self.

Returns:

A string owned by self.

Return type:

str

Returns the service type of the discovered info.

resolve(info, complete_func, *user_data)
Parameters:

Attempts to resolve info. Resolving a Infinity.DiscoveryInfo means creating a Infinity.XmlConnection to the publisher. The connection might not be open when complete_func runs.

undiscovered(info)
Parameters:

info (Infinity.DiscoveryInfo) – The undiscovered InfDiscoveryInfo.

Emits the “undiscovered” signal on self.

do_discover(type) virtual
Parameters:

type (str) – The service type to discover.

Starts the discovery of the given service type. Whenever a service of this type is discovered, the “discovered” signal is emitted. If the service disappears, the “undiscovered” signal is emitted. This can be called more than once for the same type, but only the first call has an effect.

Note also that implementations of Infinity.Discovery might restrict the service types that can be discovered.

do_discovered(info) virtual
Parameters:

info (Infinity.DiscoveryInfo) – The discovered Infinity.DiscoveryInfo.

Emits the “discovered” signal on discovery.

do_get_discovered(type) virtual
Parameters:

type (str) – The service type of which to get discovered infos for.

Returns:

A newly allocated list that needs to be freed with g_slist_free().

Return type:

[Infinity.DiscoveryInfo]

Returns a list of discovered Infinity.DiscoveryInfo for the given type.

do_info_get_service_name(info) virtual
Parameters:

info (Infinity.DiscoveryInfo) – A Infinity.DiscoveryInfo discovered by discovery.

Returns:

A newly allocated string. Free with GLib.free().

Return type:

str

Returns the service name of the discovered info.

do_info_get_service_type(info) virtual
Parameters:

info (Infinity.DiscoveryInfo) – A Infinity.DiscoveryInfo discovered by discovery.

Returns:

A string owned by discovery.

Return type:

str

Returns the service type of the discovered info.

do_resolve(info, complete_func, *user_data) virtual
Parameters:

Attempts to resolve info. Resolving a Infinity.DiscoveryInfo means creating a Infinity.XmlConnection to the publisher. The connection might not be open when complete_func runs.

do_undiscovered(info) virtual
Parameters:

info (Infinity.DiscoveryInfo) – The undiscovered InfDiscoveryInfo.

Emits the “undiscovered” signal on discovery.

Signal Details

Infinity.Discovery.signals.discovered(discovery, info)
Signal Name:

discovered

Flags:

RUN_LAST, DETAILED

Parameters:

This signal is detailed. The detail is the name of the service that has been discovered, so you can connect to “discovered::my-service-name” if you are only interested in a particular service.

Infinity.Discovery.signals.undiscovered(discovery, info)
Signal Name:

undiscovered

Flags:

RUN_LAST, DETAILED

Parameters:

This signal is emitted if a previously discovered service is no longer available.

This signal is detailed. The detail is the name of the service that has been undiscovered, so you can connect to “undiscovered::my-service-name” if you are only interested in a particular service.