GDBus: Use call() instead of invoke_method()

Lots of people been suggesting this. We still use MethodInvocation /
method_invocation for handling incoming method calls so use call()
instead of invoke_method() helps to separate the client and server
facilities. Which is a good thing(tm).
This commit is contained in:
David Zeuthen
2010-05-10 11:47:08 -04:00
parent 728c4e38e7
commit 869b4c6833
21 changed files with 694 additions and 693 deletions

View File

@@ -287,16 +287,16 @@ main (int argc, char *argv[])
g_dbus_connection_get_capabilities (connection) & G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING);
greeting = g_strdup_printf ("Hey, it's %" G_GUINT64_FORMAT " already!", (guint64) time (NULL));
value = g_dbus_connection_invoke_method_sync (connection,
NULL, /* bus_name */
"/org/gtk/GDBus/TestObject",
"org.gtk.GDBus.TestPeerInterface",
"HelloWorld",
g_variant_new ("(s)", greeting),
G_DBUS_INVOKE_METHOD_FLAGS_NONE,
-1,
NULL,
&error);
value = g_dbus_connection_call_sync (connection,
NULL, /* bus_name */
"/org/gtk/GDBus/TestObject",
"org.gtk.GDBus.TestPeerInterface",
"HelloWorld",
g_variant_new ("(s)", greeting),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
&error);
if (value == NULL)
{
g_printerr ("Error invoking HelloWorld(): %s\n", error->message);