DBusProxy.call
void call(string methodName, glib.variant.Variant parameters, gio.types.DBusCallFlags flags, int timeoutMsec, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)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 [gio.types.IOErrorEnum.Closed]. If cancellable is canceled, the operation will fail with [gio.types.IOErrorEnum.Cancelled]. If parameters contains a value not compatible with the D-Bus protocol, the operation fails with [gio.types.IOErrorEnum.InvalidArgument].
If the parameters #GVariant is floating, it is consumed. This allows convenient 'inline' use of [glib.variant.Variant.new_], e.g.:
g_dbus_proxy_call (proxy,
"TwoStrings",
g_variant_new ("(ss)",
"Thing One",
"Thing Two"),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
(GAsyncReadyCallback) two_strings_done,
&data);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 [gio.dbus_proxy.DBusProxy.callFinish] to get the result of the operation. See [gio.dbus_proxy.DBusProxy.callSync] for the synchronous version of this method.
If callback is null then the D-Bus method call message will be sent with the [gio.types.DBusMessageFlags.NoReplyExpected] flag set.
Parameters
methodName | Name of method to invoke. |
parameters | A #GVariant tuple with parameters for the signal or null if not passing parameters. |
flags | Flags from the #GDBusCallFlags enumeration. |
timeoutMsec | The timeout in milliseconds (with G_MAXINT meaning "infinite") or -1 to use the proxy default timeout. |
cancellable | A #GCancellable or null. |
callback | A #GAsyncReadyCallback to call when the request is satisfied or null if you don't care about the result of the method invocation. |