<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>>> And in my program I am doing like:
<br>>> DBus::Connection *pconn = DBus::Connection(bus_path);<br>>> pconn->register_connection();<br>>><br>>> After this it is working ok.<br>>><br>>> So I have a question, is there any other way already exist to register the
<br>>> connection, or such function is missing and we need to add one as I did<br>>> above?<br>><br>> Yes, it's a bug, as per the doc:<br>><br>> "If you open a bus connection with dbus_connection_open() or
<br>> dbus_connection_open_private() you will have to dbus_bus_register()<br>> yourself, or make the appropriate registration method calls yourself."<br>><br>> the constructor should call it and it doesn't, this hasn't come up
<br>> earlier because only the 'default' buses were being used.<br>><br><br>I don'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't right either.<br><br>dbus_bus_get() does register with the bus, since it knows it's a bus.
<br>In C++ I'd expect that to be wrapped separately and as a static or<br>factory method, rather than as a constructor.</blockquote><div><br> - I think you are correct. We can make a public method to register the connection
<br> in the bus, and the user should call the register method after creating the connection.<br> As I tried in the above example.<br> </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>