Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

bus: Name exists if present or activatable #40

Closed
wants to merge 1 commit into from

Conversation

arfbtwn
Copy link
Contributor

@arfbtwn arfbtwn commented Aug 7, 2014

Same problem as #33, but addressed in a slightly different way.

@arfbtwn arfbtwn changed the title bus: Name is owned if present or activatable bus: Name exists if present or activatable Aug 7, 2014
@smcv
Copy link

smcv commented Jul 26, 2015

I am not a C# expert, but I maintain the reference implementation of D-Bus. I wouldn't recommend doing this: it adds up to 2 extra round-trips before actually calling a method. It's more conventional in other languages' D-Bus bindings, and IMO better, to be optimistic and try to do as the programmer asked; if it fails, you get an error reply back, and can handle it normally.

Doing the check first is also a time-of-check/time-of-use bug; the service could conceivably appear or disappear between the check and the actual method call.

Handling errors gracefully is an important feature in IPC libraries anyway, because IPC calls can fail whatever you do; it is not possible to prevent this with pre-flight checks.

@arfbtwn
Copy link
Contributor Author

arfbtwn commented Aug 22, 2015

@smcv, sorry for such a long delay in response. I have to agree on the time-of check vs use argument and wasn't aware this check was added so recently before the 0.8 release.

Closing.

@arfbtwn arfbtwn closed this Aug 22, 2015
@arfbtwn arfbtwn deleted the bugfix-0.8.1 branch August 22, 2015 20:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants