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
SystemBusPrivate doesn't return a working conn. #15
Comments
The problem is that you don't want to have to do the Auth and Hello? |
The problem is shouldn't have to. expected it to return a working connection. instead I got a broken one without any documentation as to why on the method. |
I just figured out there were private/shared buses for both session and system. This explains why different parts of the code are receiving each other's messages! In any case, I couldn't get the PrivateBus to work, until I dug through the code and found this:
Which is approximately what @james-lawrence is saying. So I do agree some doc/api fixes are in order... Will test this all tomorrow! |
Incidentally, if you're not using private buses, then if you close the connection, everyone who is on the shared bus will see it closed! |
@purpleidea indeed, the docs for Close() say to not call it on shared connections. |
@philips would you accept a patch to either:
or I'd prefer the first choice, because it fixes the API to make it most logical. LMK |
I have this snippet in my code in the meantime now:
Happy to merge it upstream if someone is interested. |
@purpleidea Is there another dbus API that we can compare this Private/Base solution to? |
@philips I'm sorry, I'm not sure if I understand what you're asking. The point is to make using the "Private" version of the bus a drop in replacement for the regular dbus.SystemBus() call. |
@purpleidea I am asking how does a C or python or Java library handle this? |
On Mon, Feb 22, 2016 at 5:34 PM, Brandon Philips notifications@github.com
Oh, typically AFAIK there is a private (true/false) keyword on the main https://dbus.freedesktop.org/doc/dbus-python/api/dbus._dbus.Bus-class.html#__new__ |
Just to say, I have also been burned by this. At least an update to the API docs to say, "This doesn't return a working connection in the same way |
I agree, that is the minimum that should be done. |
I ask if it is possible to put in example a working sample code for dbus.SystemBusPrivate. Thank you. |
Are the changes in #140 sufficient? |
believe so |
managed to figure it out |
The request was to add documentation on how to use SystemBusPrivate. See the example here: https://godoc.org/github.com/godbus/dbus#SystemBusPrivate |
Stumbled across the changes in the godoc today. Looks good, thank you. |
Adressed in #140. |
to get a working conn need to invoke:
The text was updated successfully, but these errors were encountered: