since: 2.26


g_dbus_proxy_call (
  GDBusProxy* proxy,
  const gchar* method_name,
  GVariant* parameters,
  GDBusCallFlags flags,
  gint timeout_msec,
  GCancellable* cancellable,
  GAsyncReadyCallback callback,
  gpointer user_data


Asynchronously invokes the method_name method on proxy.

If method_name contains any dots, then name is split into interface and method name parts. This allows using proxy for invoking methods on other interfaces.

If the GDBusConnection associated with proxy is closed then the operation will fail with G_IO_ERROR_CLOSED. If cancellable is canceled, the operation will fail with G_IO_ERROR_CANCELLED. If parameters contains a value not compatible with the D-Bus protocol, the operation fails with G_IO_ERROR_INVALID_ARGUMENT.

If the parameters GVariant is floating, it is consumed. This allows convenient ‘inline’ use of g_variant_new(), e.g.:

 g_dbus_proxy_call (proxy,
                    g_variant_new ("(ss)",
                                   "Thing One",
                                   "Thing Two"),
                    (GAsyncReadyCallback) two_strings_done,

If proxy has an expected interface (see GDBusProxy:g-interface-info) and method_name is referenced by it, then the return value is checked against the return type.

This is an asynchronous method. When the operation is finished, callback will be invoked in the [thread-default main context][g-main-context-push-thread-default] of the thread you are calling this method from. You can then call g_dbus_proxy_call_finish() to get the result of the operation. See g_dbus_proxy_call_sync() for the synchronous version of this method.

If callback is NULL then the D-Bus method call message will be sent with the G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.

Available since: 2.26



Type: const gchar*

Name of method to invoke.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Type: GVariant

A GVariant tuple with parameters for the signal or NULL if not passing parameters.

The argument can be NULL.
The data is owned by the caller of the function.

Type: GDBusCallFlags

Flags from the GDBusCallFlags enumeration.


Type: gint

The timeout in milliseconds (with G_MAXINT meaning “infinite”) or -1 to use the proxy default timeout.


Type: GCancellable

A GCancellable or NULL.

The argument can be NULL.
The data is owned by the caller of the function.

Type: GAsyncReadyCallback

A GAsyncReadyCallback to call when the request is satisfied or NULL if you don’t care about the result of the method invocation.

The argument can be NULL.

Type: gpointer

The data to pass to callback.

The argument can be NULL.
The data is owned by the caller of the function.