notification of disconnect?

Marcel Holtmann marcel at holtmann.org
Fri Jul 31 03:13:19 PDT 2009


Hi Colin,

> > Hi all. I'm writing a client-server application where the server needs
> > to be aware of the clients currently running. Is there a way to make
> > dbus send a signal to my server when a certain application has lost
> > connection to dbus?
> 
> Each process connected to the bus has a "unique name", and the bus
> will send you notifications (NameOwnerChanged) when those names appear
> or disappear.  A pattern used by some programs like bluetooth is the
> "agent" pattern where the client sends a "Register" message with its
> unique name, then the server monitors that client and sends messages
> directly to it.

actually BlueZ uses this on a massive scale. We monitor almost every
client transaction. For example when a client trigger a scan and the
decides to exit or crash we stop scanning and cleanup after the client.

It is a pretty smart way to cleanup around buggy or broken client
without them able to prevent it :)

Regards

Marcel




More information about the dbus mailing list