dbus_bus_get(DBUS_BUS_SESSION, &error) hangs indefinitely on OS X
Rick Mann
rmann at latencyzero.com
Wed Oct 14 23:07:30 PDT 2015
Calling dbus_bus_get(DBUS_BUS_SESSION, &error) on OS X 10.10.5, dbus_bus_get(DBUS_BUS_SESSION, &error) hangs indefinitely. This is in code that used to work, and for some reason has stopped. I haven't worked with this project for some time, but as far as I can tell, haven't made any changes that should affect this.
I use OS X's launchd to launch dbus. It creates a Unix domain socket like this:
$ echo $DBUS_LAUNCHD_SESSION_BUS_SOCKET
/private/tmp/com.apple.launchd.y24Av06XkO/unix_domain_listener
If I kill the dbus agent, the call returns with an error:
DBusError.name: org.freedesktop.DBus.Error.NoReply
DBusError.message: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
How can I make this call without it blocking at all? I have two things, a C++ app and a node.js app, that need to talk to each other, but I can't guarantee that one will launch before the other, and I need both to work without the other existing (obviously communications between them can fail).
What's the best way to accomplish that?
Thanks,
--
Rick Mann
rmann at latencyzero.com
More information about the dbus
mailing list