1 /* -*- mode: C; c-file-style: "gnu" -*- */
6 main (int argc, char **argv)
8 DBusConnection *connection;
9 DBusMessage *message, *reply;
15 g_printerr ("Give the server address as an argument\n");
19 loop = g_main_loop_new (NULL, FALSE);
21 dbus_error_init (&error);
22 connection = dbus_connection_open (argv[1], &error);
23 if (connection == NULL)
25 g_printerr ("Failed to open connection to %s: %s\n", argv[1],
27 dbus_error_free (&error);
31 dbus_connection_setup_with_g_main (connection, NULL);
33 message = dbus_message_new_method_call (DBUS_SERVICE_ORG_FREEDESKTOP_DBUS,
34 DBUS_PATH_ORG_FREEDESKTOP_DBUS,
35 DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS,
38 dbus_error_init (&error);
39 reply = dbus_connection_send_with_reply_and_block (connection, message, -1, &error);
42 g_printerr ("Error on hello message: %s\n", error.message);
43 dbus_error_free (&error);
47 g_print ("reply received\n");
49 g_main_loop_run (loop);