I’m trying to hack an extra feature to the quodlibet mpris plugin. If you want more details on what I’m trying to do, please see: http://code.google.com/p/quodlibet/issues/detail?id=889 , but that should not be necessary to answer the question.
The plugin inits a number of dbus.service.Object classes when the plugin starts. I would like to get, for one of the objects, the number of dbus ProxyObject clients that exist for the object, e.g. I want to know how many clients are connected.
As far as I understand, there are no ‘connections’ or other stateful relations between DBus service provider and DBus service consumer (at least there is no mention of this in DBus message protocol spec). From the spec it can be seen clearly that all that ProxyObject and stuff like that are solely the client implementation details, and you can’t detect if there are any ‘clients’ for your DBus service hanging out there.
You can probably either use some non-standard extensions to MPRIS (like ‘ping’ messages for example) and ask clients to comply with these extensions, or you can make a configurable option like “don’t quit quodlibet if any of the following processes are running”.