bus: Name exists if present or activatable#40
Conversation
|
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. |
|
@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. |
Same problem as #33, but addressed in a slightly different way.