How to check if sender of message still exists?

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Jun 9 03:41:35 PDT 2011


On Thu, 09 Jun 2011 at 12:34:31 +0200, Krzysztof wrote:
> But what if plugin suddenly is terminated (killed) and could not
> send absence method and serwer still showing it as connected?

If you're listening for the NameOwnerChanged signal you will see the ownership
of the plugin's unique name change from itself to the empty string:

    NameOwnerChanged(":1.407", ":1.407", "")

That's how you detect a process leaving D-Bus, for instance by exiting.

See the D-Bus Specification for more about NameOwnerChanged, or (for instance)
tp_dbus_daemon_watch_name_owner() in telepathy-glib for example.code.

    S


More information about the dbus mailing list