コード例 #1
0
DBusGProxy *
get_dbus_proxy (void)
{
    DBusGConnection *connection;
    DBusGProxy *proxy = NULL;

    connection = dbus_g_connection_open("unix:path=/tmp/mz-test-sendmail", NULL);
    if (connection) {
        proxy = dbus_g_proxy_new_for_peer(connection,
                                          "/org/MilterZipcrypt/Sendmail",
                                          "org.MilterZipcrypt.Sendmail");
    }
    return proxy;
}
コード例 #2
0
ファイル: client.c プロジェクト: herzi/p2p-dbus
static gboolean
send_echo (gpointer  connection)
{
  DBusGProxy* proxy = dbus_g_proxy_new_for_peer (connection, "/", "eu.herzi.P2PObject");
  GError    * error = NULL;
  gchar     * echo;

  if (!eu_herzi_P2PObject_echo (proxy, "hello", &echo, &error))
    {
      g_warning ("error calling echo: %s", error->message);
      g_error_free (error);
    }
  else
    {
      g_print ("\"hello\" => \"%s\"\n", echo);
      g_free (echo);
    }
  g_object_unref (proxy);

  g_main_loop_quit (loop);

  return FALSE;
}