Re: Check whether a dbus caller is still alive

Lawrence D'Oliveiro <ldo-kC51rjc0cqs1dNLGKZg6taU/[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Organization Geek Central
Message-ID <[email protected]>
On Sun, 1 Oct 2017 22:28:07 +0100, David Llewellyn-Jones wrote:

> When you say 'get the client pid from the
> request message', do you mean get the client to send its pid as a
> parameter, or is there a way to extract the pid from the request?

OK, I misremembered how it actually works. You can get the sender
unique name from the message. Then ask the D-Bus daemon itself for the
process ID corresponding to this name, with the
GetConnectionUnixProcessID method request
<https://dbus.freedesktop.org/doc/dbus-specification.html>.

You can do the latter just once per request, then save the process ID
with your context for servicing that request and poll it periodically as
I described.
_______________________________________________
dbus mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dbus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.