Skip to content
  • Ralf Habacker's avatar
    tools/dbus-run-session: fix race between manual and automatically started dbus-daemon on Windows · 79df3d28
    Ralf Habacker authored
    dbus-run-session starts a dbus-daemon before the client application.
    We must avoid letting the application try to connect before the
    dbus-daemon's DBusServer is listening for connections.
    
    In the Unix implementation, we already achieved this via the
    --print-address option. If the client tried to connect too soon,
    the server would not yet be listening and the client would fail.
    
    In the Windows implementation, we communicate the bus address to
    the client application as an autolaunch: address, so if the client
    tried to connect too soon, it would autolaunch a new dbus-daemon
    instead of using the one that it was intended to use.
    
    We can avoid this by using a new option to pass in a Windows event
    object, which will be set when the server has started and is ready
    to process connections.
    
    Fixes #297
    79df3d28