Top | ![]() |
![]() |
![]() |
![]() |
void | (*InfDiscoveryResolvCompleteFunc) () |
void | inf_discovery_discover () |
GSList * | inf_discovery_get_discovered () |
void | inf_discovery_resolve () |
gchar * | inf_discovery_info_get_service_name () |
const gchar * | inf_discovery_info_get_service_type () |
void | inf_discovery_discovered () |
void | inf_discovery_undiscovered () |
InfDiscovery provides a common interface for the discovery of services. Discovered services are represented by InfDiscoveryInfo objects and can be used to query the name of the discovered service.
To create a connection to the host providing a discovered service, use
inf_discovery_resolve()
.
void (*InfDiscoveryResolvCompleteFunc) (InfDiscoveryInfo *info
,InfXmlConnection *connection
,const GError *error
,gpointer user_data
);
This callback is called when a call to inf_discovery_resolve()
finished.
info |
The resolved InfDiscoveryInfo. |
|
connection |
The resulting InfXmlConnection. |
|
error |
Reason in case of failure. |
|
user_data |
The user_data passed to |
void inf_discovery_discover (InfDiscovery *discovery
,const gchar *type
);
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 InfDiscovery might restrict the service types that can be discovered.
GSList * inf_discovery_get_discovered (InfDiscovery *discovery
,const gchar *type
);
Returns a list of discovered InfDiscoveryInfo for the given type.
void inf_discovery_resolve (InfDiscovery *discovery
,InfDiscoveryInfo *info
,InfDiscoveryResolvCompleteFunc complete_func
,gpointer user_data
);
Attempts to resolve info
. Resolving a InfDiscoveryInfo means creating
a InfXmlConnection to the publisher. The connection might not be
open when complete_func
runs.
discovery |
A InfDiscovery. |
|
info |
A InfDiscoveryInfo discovered by |
|
complete_func |
A callback that will be called when the resolving process has completed. |
[scope async] |
user_data |
Extra data to pass to |
gchar * inf_discovery_info_get_service_name (InfDiscovery *discovery
,InfDiscoveryInfo *info
);
Returns the service name of the discovered info
.
const gchar * inf_discovery_info_get_service_type (InfDiscovery *discovery
,InfDiscoveryInfo *info
);
Returns the service type of the discovered info
.
void inf_discovery_discovered (InfDiscovery *discovery
,InfDiscoveryInfo *info
);
Emits the "discovered" signal on discovery
.
void inf_discovery_undiscovered (InfDiscovery *discovery
,InfDiscoveryInfo *info
);
Emits the "undiscovered" signal on discovery
.
typedef struct _InfDiscovery InfDiscovery;
InfDiscovery is an opaque data type. You should only access it via the public API functions.
struct InfDiscoveryInterface { void (*discover)(InfDiscovery* discovery, const gchar* type); GSList* (*get_discovered)(InfDiscovery* discovery, const gchar* type); void (*resolve)(InfDiscovery* discovery, InfDiscoveryInfo* info, InfDiscoveryResolvCompleteFunc complete_func, gpointer user_data); gchar*(*info_get_service_name)(InfDiscovery* discovery, InfDiscoveryInfo* info); const gchar*(*info_get_service_type)(InfDiscovery* discovery, InfDiscoveryInfo* info); /* Signals */ void (*discovered)(InfDiscovery* discovery, InfDiscoveryInfo* info); void (*undiscovered)(InfDiscovery* discovery, InfDiscoveryInfo* info); };
The virtual methods and default signal handlers of InfDiscovery. Implementing these allows discovering infinote servers.
Virtual function to start discovery of services of the given type. If the discovery was already started ealier, then this function does nothing. |
||
Virtual function to retrieve a list of
InfDiscoveryInfos that represent discovered services.
It needs to be freed by the caller via |
||
Virtual function that attempts to resolve the given discovery
info. It guarantees to either call |
||
Returns the service name of the given
InfDiscoveryInfo as a new string, to be freed by the caller with |
||
Returns the type of the discovered service of the given InfDiscoveryInfo as a static string. |
||
Default signal handler for the “discovered” signal. |
||
Default signal handler for the “undiscovered” signal. |
typedef struct _InfDiscoveryInfo InfDiscoveryInfo;
InfDiscoveryInfo is an opaque data type. You should only access it via the public API functions.
“discovered”
signalvoid user_function (InfDiscovery *discoverer, gpointer info, gpointer user_data)
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.
discoverer |
The InfDiscovery object discovering something |
|
info |
The InfDiscoveryInfo describing the discovered service |
|
user_data |
user data set when the signal handler was connected. |
Flags: Has Details
“undiscovered”
signalvoid user_function (InfDiscovery *discoverer, gpointer info, gpointer user_data)
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.
discoverer |
The InfDiscovery object undiscovering something |
|
info |
The InfDiscoveryInfo describing the undiscovered service |
|
user_data |
user data set when the signal handler was connected. |
Flags: Has Details