| EggDBus Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Prerequisites | ||||
EggDBusPeer;
EggDBusPeerIface;
#define EGG_DBUS_QUERY_INTERFACE_PEER (object_proxy)
gboolean egg_dbus_peer_ping_sync (EggDBusPeer *instance,
EggDBusCallFlags call_flags,
GCancellable *cancellable,
GError **error);
gboolean egg_dbus_peer_get_machine_id_sync (EggDBusPeer *instance,
EggDBusCallFlags call_flags,
gchar **out_machine_uuid,
GCancellable *cancellable,
GError **error);
guint egg_dbus_peer_ping (EggDBusPeer *instance,
EggDBusCallFlags call_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean egg_dbus_peer_ping_finish (EggDBusPeer *instance,
GAsyncResult *res,
GError **error);
guint egg_dbus_peer_get_machine_id (EggDBusPeer *instance,
EggDBusCallFlags call_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean egg_dbus_peer_get_machine_id_finish (EggDBusPeer *instance,
gchar **out_machine_uuid,
GAsyncResult *res,
GError **error);
void egg_dbus_peer_handle_ping_finish (EggDBusMethodInvocation *method_invocation);
void egg_dbus_peer_handle_get_machine_id_finish
(EggDBusMethodInvocation *method_invocation,
const gchar *out_machine_uuid);
All D-Bus objects are supposed to implement the EggDBusPeer D-Bus interface. The interface is designed to be a minimal interface for checking whether the other end is reachable and, if so, what machine hosts the object.
typedef struct {
EggDBusInterfaceIface g_iface;
void (* handle_ping) (
EggDBusPeer *instance,
EggDBusMethodInvocation *method_invocation);
void (* handle_get_machine_id) (
EggDBusPeer *instance,
EggDBusMethodInvocation *method_invocation);
} EggDBusPeerIface;
Interface VTable for implementing the org.freedesktop.DBus.Peer D-Bus interface.
EggDBusInterfaceIface |
The parent interface. |
|
A method used to diagnose whether an object is reachable. |
|
Gets the Machine UUID of the machine hosting the object. |
#define EGG_DBUS_QUERY_INTERFACE_PEER(object_proxy) (EGG_DBUS_PEER (egg_dbus_object_proxy_query_interface (object_proxy, EGG_DBUS_TYPE_PEER)))
Convenience macro to get an interface proxy for the remote object represented
by object_proxy. See egg_dbus_object_proxy_query_interface() for details.
|
A EggDBusObjectProxy. |
Returns : |
An instance derived from EggDBusInterfaceProxy that implements the
EggDBusPeer interface. This instance can be used to access the
org.freedesktop.DBus.Peer D-Bus interface on the remote
object represented by object_proxy. Do not ref or unref the returned instance,
it is owned by object_proxy.
|
gboolean egg_dbus_peer_ping_sync (EggDBusPeer *instance, EggDBusCallFlags call_flags, GCancellable *cancellable, GError **error);
A method used to diagnose whether an object is reachable.
This function synchronously invokes the Ping() method on the org.freedesktop.DBus.Peer interface on the object represented by instance.
See egg_dbus_peer_ping() for the asynchronous version of this function.
|
A EggDBusPeer. |
|
Flags from EggDBusCallFlags detailing how the method should be invoked. |
|
A GCancellable or NULL.
|
|
Return location for error. |
Returns : |
TRUE if the method call succeeded, FALSE if error is set.
|
gboolean egg_dbus_peer_get_machine_id_sync (EggDBusPeer *instance, EggDBusCallFlags call_flags, gchar **out_machine_uuid, GCancellable *cancellable, GError **error);
Gets the Machine UUID of the machine hosting the object.
This function synchronously invokes the GetMachineId() method on the org.freedesktop.DBus.Peer interface on the object represented by instance.
See egg_dbus_peer_get_machine_id() for the asynchronous version of this function.
|
A EggDBusPeer. |
|
Flags from EggDBusCallFlags detailing how the method should be invoked. |
|
A Universally Unique Identifier for the machine hosting the object. See the D-Bus specification for more information about D-Bus UUIDs. Free with g_free().
|
|
A GCancellable or NULL.
|
|
Return location for error. |
Returns : |
TRUE if the method call succeeded, FALSE if error is set.
|
guint egg_dbus_peer_ping (EggDBusPeer *instance, EggDBusCallFlags call_flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
A method used to diagnose whether an object is reachable.
This function asynchronously invokes the Ping() method
on the org.freedesktop.DBus.Peer interface
on the object represented by instance.
When the reply is ready, callback will be called (on the main thread).
You can then call egg_dbus_peer_ping_finish() to get the result.
See egg_dbus_peer_ping_sync() for the synchronous version of this function.
|
A EggDBusPeer. |
|
Flags from EggDBusCallFlags detailing how the method should be invoked. |
|
A GCancellable or NULL.
|
|
Callback to invoke when the reply is ready. |
|
User data to pass to callback.
|
Returns : |
A pending call id (never zero) that can be used with egg_dbus_connection_pending_call_cancel() or egg_dbus_connection_pending_call_block().
|
gboolean egg_dbus_peer_ping_finish (EggDBusPeer *instance, GAsyncResult *res, GError **error);
Finishes an asynchronous method invocation started with egg_dbus_peer_ping().
|
A EggDBusPeer. |
|
A GAsyncResult obtained from the GAsyncReadyCallback function passed to egg_dbus_peer_ping().
|
|
Return location for error. |
Returns : |
TRUE if the method call succeeded, FALSE if error is set.
|
guint egg_dbus_peer_get_machine_id (EggDBusPeer *instance, EggDBusCallFlags call_flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
Gets the Machine UUID of the machine hosting the object.
This function asynchronously invokes the GetMachineId() method
on the org.freedesktop.DBus.Peer interface
on the object represented by instance.
When the reply is ready, callback will be called (on the main thread).
You can then call egg_dbus_peer_get_machine_id_finish() to get the result.
See egg_dbus_peer_get_machine_id_sync() for the synchronous version of this function.
|
A EggDBusPeer. |
|
Flags from EggDBusCallFlags detailing how the method should be invoked. |
|
A GCancellable or NULL.
|
|
Callback to invoke when the reply is ready. |
|
User data to pass to callback.
|
Returns : |
A pending call id (never zero) that can be used with egg_dbus_connection_pending_call_cancel() or egg_dbus_connection_pending_call_block().
|
gboolean egg_dbus_peer_get_machine_id_finish (EggDBusPeer *instance, gchar **out_machine_uuid, GAsyncResult *res, GError **error);
Finishes an asynchronous method invocation started with egg_dbus_peer_get_machine_id().
|
A EggDBusPeer. |
|
A Universally Unique Identifier for the machine hosting the object. See the D-Bus specification for more information about D-Bus UUIDs. Free with g_free().
|
|
A GAsyncResult obtained from the GAsyncReadyCallback function passed to egg_dbus_peer_get_machine_id().
|
|
Return location for error. |
Returns : |
TRUE if the method call succeeded, FALSE if error is set.
|
void egg_dbus_peer_handle_ping_finish (EggDBusMethodInvocation *method_invocation);
Function to be called by implementers of the org.freedesktop.DBus.Peer D-Bus interface to finish handling the Ping() method.
|
A EggDBusMethodInvocation. |
void egg_dbus_peer_handle_get_machine_id_finish
(EggDBusMethodInvocation *method_invocation,
const gchar *out_machine_uuid);
Function to be called by implementers of the org.freedesktop.DBus.Peer D-Bus interface to finish handling the GetMachineId() method.
|
A Universally Unique Identifier for the machine hosting the object. See the D-Bus specification for more information about D-Bus UUIDs. |
|
A EggDBusMethodInvocation. |