Listen mode and remote message bus

Havoc Pennington hp@redhat.com
Tue, 21 Oct 2003 00:59:53 -0400


On Fri, 2003-10-17 at 23:45, Anders Feder wrote:
> I'm developing a neat little application using D-BUS and have figured
> out how to make it acquire ownership of a service. Now I need to put the
> application into listen mode. Can somebody please give me a brief
> tutorial on how to do that? I've read references to things like 'message
> handlers' and 'message matching rules' but can't quite figure out what
> they are or how to use them.

The tutorial for the raw C libdbus would be relatively complicated as
you have to write your own main loop and stuff; I started on a tutorial
that will include using D-BUS via GLib, etc., but I haven't gotten too
far yet. It's on the dbus home page.

Using D-BUS via GLib hopefully _will_ be relatively brief, however,
support for writing a server with the GLib setup isn't fully implemented
yet.

In the meantime, dbus-monitor.c, and the bus daemon (in bus/*) are some
possible useful examples. Or test/test-service.c which I am about to
commit a change to that makes it use the new path registration API
features.

> And another thing: will it be possible to use a remote message bus as
> your default session or system bus? Imagine marking that 32 characters
> long IPv6 address on machine A, pressing Ctrl+C, walking over to machine
> B, pressing Ctrl+V and then watching all 32 characters pop up on the
> screen of the other machine. Pure magic.
> 

Yes, we have a TCP transport now. What's missing though are the
authentication and encryption support; e.g. you might do Kerberos, SSL.
Adding support for Cyrus SASL is one way to achieve this.

Havoc