Creating a dbus connection

Naveen Verma ernaveenverma at gmail.com
Thu Jul 5 07:16:23 PDT 2007


Hi All,

I have just started learning the dbus c++ binding. I have already used the
dbus c apis so I have understanding of that.
In c++ binding, I am trying to make a dbus connection without using static
function like DBus::Connection::SessionBus() etc. I found two public
constructors DBus::Connection(Private*)
, and DBus::Connection(const char * address, bool priv = true). I am unable
to understand how to use first one. But I tried to use second one, but in
the second one it seems it does not
register the connection. So when I execute, it abort with the error that
connection is not registered.

As per my previous understanding, there is a function in dbus C apis,
dbus_bus_register() to register a connection. To test it I have added a
public function in DBus::Connection class as:
bool register_connection() {
   return dbus_bus_register(_pvt->conn);
}


And in my program I am doing like:
DBus::Connection *pconn = DBus::Connection(bus_path);
pconn->register_connection();

After this it is working ok.

So I have a question, is there any other way already exist to register the
connection, or such function is missing and we need to add one as I did
above?

Btv,  is there any api documentation for dbus c++ bindings?

-Best Regards
Naveen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20070705/3b1c1d05/attachment.htm 


More information about the dbus mailing list