Error in dbus_bus_register

tomylan vydaman vydaman at live.fr
Sun Dec 7 07:49:00 PST 2008





Hello,
To communicate between applications in a local network, I take a known use case of DBus: shared NFS home directories for one user in multi-hosts as following:My dbus configuration file : session-testdb.conf<!-- This configuration file controls the per-user-login-session message bus.     Add a session-local.conf and edit that rather than changing this     file directly. --><!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"><busconfig>  <!-- Our well-known bus type, don't change this -->  <type>session</type>  <listen>tcp:host=localhost,bind=*,port=0,family=ipv4</listen>  <auth>DBUS_COOKIE_SHA1</auth>…My code:  session_addr = strdup (getenv ("DBUS_SESSION_BUS_ADDRESS"));  conn = dbus_connection_open (session_addr, &err);  free (session_addr);  if (dbus_error_is_set(&err)) {      fprintf(stderr, "Connection Error (%s)\n", err.message);      dbus_error_free(&err);  }  if (NULL == conn) {     exit(1);  }  if (!dbus_bus_register (conn, &err))  {      g_warning ("Client failed to register with the D-BUS:\n%s", err.message);      dbus_connection_close (conn);      dbus_connection_unref (conn);      conn = NULL;      dbus_error_free (&err);      exit(1);  } My application launch:dbus-lauch –config-file=session-testdb.conf myapplication My application works well in one host when DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-xvv…But when DBUS_SESSION_BUS_ADDRESS is defined by "session-testdb.conf" as above, it has a problem in the function "dbus_bus_register" with the warning message: "Client failed to register with the D-BUS:(Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.) "If I remove this function "dbus_bus_register", my application seems to work in multi-hosts without error but receivers and senders cannot recognize each other. Therefore, I think my application does need this function "dbus_bus_register" to communicate each other.Could somebody give me some suggestions about the reason of this error ?Thank you in advance and best regardsTomylan 
_________________________________________________________________
Inédit ! Des Emoticônes Déjantées! Installez les dans votre Messenger ! 
http://www.ilovemessenger.fr/Emoticones/EmoticonesDejantees.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20081207/e98ef35a/attachment.htm 


More information about the dbus mailing list