<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<BR><BR>
<STYLE>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</STYLE>
<P class=EC_MsoNormal><SPAN style="FONT-SIZE: 11pt"><FONT face=Arial color=#000000>Hello,</FONT></SPAN></P>
<P class=EC_MsoNormal><FONT face=Arial></FONT><SPAN lang=EN-GB style="FONT-SIZE: 11pt"><FONT color=#000000></P><PRE><FONT size=2><FONT face=Arial><SPAN lang=EN-GB style="mso-ansi-language: EN-GB">To communicate between applications in a local network, I take a known use case of DBus: </SPAN><SPAN lang=EN style="COLOR: black; mso-ansi-language: EN">shared NFS home directories for one user in multi-hosts as following:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></FONT></PRE><PRE><SPAN lang=EN style="COLOR: black; mso-ansi-language: EN"><o:p><FONT face=Arial size=2></FONT></o:p></SPAN></PRE><PRE><SPAN lang=EN style="COLOR: black; mso-ansi-language: EN"><FONT size=2><FONT face=Arial>My dbus configuration file : session-testdb.conf<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><!-- This configuration file controls the per-user-login-session message bus.<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>Add a session-local.conf and edit that rather than changing this<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>file directly. --><o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><o:p><FONT face=Arial size=2></FONT></o:p></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial> "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"><o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><busconfig><o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN><!-- Our well-known bus type, don't change this --><o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN><type>session</type><o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><o:p><FONT face=Arial size=2></FONT></o:p></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN><listen>tcp:host=localhost,bind=*,port=0,family=ipv4</listen><o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><o:p><FONT face=Arial size=2></FONT></o:p></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN><auth>DBUS_COOKIE_SHA1</auth><o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial>…<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><o:p><FONT face=Arial size=2></FONT></o:p></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial>My code:<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><o:p><FONT face=Arial size=2></FONT></o:p></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>session_addr = strdup (getenv ("DBUS_SESSION_BUS_ADDRESS"));<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>conn = dbus_connection_open (session_addr, &err);<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>free (session_addr);<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>if (dbus_error_is_set(&err)) {<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>fprintf(stderr, "Connection Error (%s)\n", err.message);<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>dbus_error_free(&err);<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>}<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>if (NULL == conn) {<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial> <SPAN style="mso-spacerun: yes"> </SPAN>exit(1);<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>}<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>if (!dbus_bus_register (conn, &err))<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>{<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>g_warning ("Client failed to register with the D-BUS:\n%s", err.message);<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>dbus_connection_close (conn);<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>dbus_connection_unref (conn);<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>conn = NULL;<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>dbus_error_free (&err);<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>exit(1);<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><o:p><FONT face=Arial size=2></FONT></o:p></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial><SPAN style="mso-spacerun: yes"> </SPAN>}<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><o:p><FONT face=Arial size=2> </FONT></o:p></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial>My application launch:<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><o:p><FONT face=Arial size=2></FONT></o:p></SPAN></PRE><PRE><FONT size=2><FONT face=Arial><SPAN lang=EN-GB style="mso-ansi-language: EN-GB">dbus-lauch –config-file=</SPAN><SPAN lang=EN style="COLOR: black; mso-ansi-language: EN">session-testdb.conf myapplication</SPAN></FONT></FONT></PRE><PRE><FONT size=2><FONT face=Arial><SPAN lang=EN style="COLOR: black; mso-ansi-language: EN"></SPAN></FONT></FONT> </PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial>My application works well in one host when DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-xvv…<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><FONT size=2><FONT face=Arial><SPAN lang=EN-GB style="mso-ansi-language: EN-GB">But when DBUS_SESSION_BUS_ADDRESS is defined by "</SPAN><SPAN lang=EN style="COLOR: black; mso-ansi-language: EN">session-testdb.conf" as above, it has a problem in the function "</SPAN><SPAN lang=EN-GB style="mso-ansi-language: EN-GB">dbus_bus_register" with the warning message: "Client failed to register with the D-BUS:<o:p></o:p></SPAN></FONT></FONT></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial>(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.) "<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><o:p><FONT face=Arial size=2></FONT></o:p></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial>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.</FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=2><FONT face=Arial>Could somebody give me some suggestions about the reason of this error ?</FONT></FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT face=Arial size=2>Thank you in advance and best regards</FONT></SPAN></PRE><PRE><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT face=Arial size=2>Tomylan</FONT></SPAN></FONT></SPAN><BR><SPAN lang=EN-GB style="FONT-SIZE: 11pt; FONT-FAMILY: 'Times New Roman'"><FONT color=#000000></SPAN><FONT face=Arial> </FONT></FONT><FONT face=Arial><FONT size=2><BR></FONT></FONT></PRE><br /><hr />Souhaitez vous « être au bureau sans y être » ? <a href='http://www.microsoft.com/france/windows/bts/default.mspx' target='_new'>Oui je le veux !</a></body>
</html>