Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method Caller PID and disconnection from session dbus #248

Open
yousefvand opened this issue Jul 12, 2021 · 1 comment
Open

Method Caller PID and disconnection from session dbus #248

yousefvand opened this issue Jul 12, 2021 · 1 comment
Labels

Comments

@yousefvand
Copy link

Considering server example and process A and B if one of them calls Foo method, how can I find it's PID and say it was A for example.
If both A and B are connected to session dbus and B gets disconnected from session dbus how can I inform about that (this is possible in C++ dbus library).

@guelfey
Copy link
Member

guelfey commented Jan 5, 2022

Considering server example and process A and B if one of them calls Foo method, how can I find it's PID and say it was A for example.

This is right now not possible with the "high-level" server mechanisms, but you can use Eavesdrop to get the sender of messages as well, and then query the process id of the sender using org.freedesktop.DBus.GetConnectionUnixProcessID.

If both A and B are connected to session dbus and B gets disconnected from session dbus how can I inform about that (this is possible in C++ dbus library).

Not sure if I understand you correctly; my best guess would be https://dbus.freedesktop.org/doc/dbus-specification.html#bus-messages-name-lost. If you have the C++ library ready, do you have a link to the documentation of this and/or some example code for what you mean?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants