Tracking Application Lifetime [again]
Thiago Macieira
thiago at kde.org
Thu Aug 7 01:09:08 PDT 2008
On Thursday 07 August 2008 08:21:58 Soh Kam Yung wrote:
> Does anybody have an archive of the notes or can help give pointers on
> how to use libdbus to track application lifetimes?
Pre-requisite: both applications (tracker and "trackee") are connected to D-
Bus
Step 1: tracker somehow finds out which, out of the many applications
connected to D-Bus, is the one it wants to track.
Suggestions:
- the tracked application registers a well known name (org.foo.Application)
- the tracked application is doing some kind of activity, like emitting a
signal or calling the tracker, so the tracker gets the unique ID (:1.xx)
Step 2: tracker starts listening for the org.freedesktop.DBus.NameOwnerChanged
signal, where the first argument is the connection name being tracked (either
the well-known name or the unique ID). Any activity in that name means it
either changed owners or that the application exited.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freedesktop.org/archives/dbus/attachments/20080807/f7e62cc5/attachment-0001.pgp
More information about the dbus
mailing list