<br>Hi,<br><div><span class="gmail_quote"><br></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br>P. Durante wrote:<br>&gt;&gt; And in my program I am doing like:
<br>&gt;&gt; DBus::Connection *pconn = DBus::Connection(bus_path);<br>&gt;&gt; pconn-&gt;register_connection();<br>&gt;&gt;<br>&gt;&gt; After this it is working ok.<br>&gt;&gt;<br>&gt;&gt; So I have a question, is there any other way already exist to register the
<br>&gt;&gt; connection, or such function is missing and we need to add one as I did<br>&gt;&gt; above?<br>&gt;<br>&gt; Yes, it&#39;s a bug, as per the doc:<br>&gt;<br>&gt; &quot;If you open a bus connection with dbus_connection_open() or
<br>&gt; dbus_connection_open_private() you will have to dbus_bus_register()<br>&gt; yourself, or make the appropriate registration method calls yourself.&quot;<br>&gt;<br>&gt; the constructor should call it and it doesn&#39;t, this hasn&#39;t come up
<br>&gt; earlier because only the &#39;default&#39; buses were being used.<br>&gt;<br><br>I don&#39;t understand this - the docs you quoted indicate that<br>connection_open() will not register with the bus, which is correct,
<br>because a DBusConnection does not have to be a connection to a bus.<br>So having the C++ wrapper for connection_open register isn&#39;t right either.<br><br>dbus_bus_get() does register with the bus, since it knows it&#39;s a bus.
<br>In C++ I&#39;d expect that to be wrapped separately and as a static or<br>factory method, rather than as a constructor.</blockquote><div><br>&nbsp;&nbsp; - I think you are correct. We can make a public method to register the connection
<br>&nbsp;&nbsp;&nbsp;&nbsp; in the bus, and the user should call the register method after creating the connection.<br>&nbsp;&nbsp;&nbsp; As I tried in the above example.<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Havoc</blockquote><div><br>-Br<br>Naveen <br></div><br></div><br>