using dbus peer to peer, i.e. without external bus daemon

Havoc Pennington havoc.pennington at gmail.com
Tue Mar 24 06:36:21 PDT 2009


Hi,

On Tue, Mar 24, 2009 at 5:50 AM, Alexander Neundorf
<neundorf at eit.uni-kl.de> wrote:
> is there somewhere documentation or a simple example how to use libdbus
> without dbus-daemon ?

Not really any simple examples; two examples are local-export-daemon
(in gnome svn) and dbus-daemon itself.

> I guess from the client side not much changes, except the address to connect
> to ?

Right, and none of the APIs in dbus-bus.h will work or make sense. So
there are no bus names, signal match rules, etc. - those are all
features of dbus-daemon

> Is it maybe like this ?
> I do the same in my server as when using an external dbus daemon, but instead
> of connecting to the daemon I call dbus_server_listen(), and then call the
> add_watch() function on the server, instead of on the connection ?
> Additionally I then have to call dbus_server_set_new_connection_function() ?
> And there I have to call dbus_connection_ref() on the new connection and keep
> the pointer somewhere ?
> If I then send something from the server, I guess I have to choose the
> appropriate connection and send my message there.
> I guess I would also have to implement the signal filter matching if I want to
> support this ?

That all sounds correct.

Havoc


More information about the dbus mailing list