sd-bus: add new sd_bus_set_connected_signal() API
authorLennart Poettering <lennart@poettering.net>
Tue, 19 Dec 2017 14:50:05 +0000 (15:50 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 5 Jan 2018 12:58:32 +0000 (13:58 +0100)
commitb38cc8d5631253738d5474f39b2026eb5524f772
tree69cc94e213d72ea2235c87e94bafb1dee4dbd9bd
parentbdbc866914e54189d6f9924349005fa8fa6bf71b
sd-bus: add new sd_bus_set_connected_signal() API

With this new API sd-bus can synthesize a local "Connected" signal when
the connection is fully established. It mirrors the local "Disconnected"
signal that is already generated when the connection is terminated. This
is useful to be notified when connection setup is done, in order to
start method calls then, in particular when using "slow" connection
methods (for example slow TCP, or most importantly the "watch_bind"
inotify logic).

Note that one could also use hook into the initial NameAcquired signal
received from the bus broker, but that scheme works only if we actually
connect to a bus. The benefit of "Connected" OTOH is that it works with
any kind of connection.

Ideally, we'd just generate this message unconditionally, but in order
not to break clients that do not expect this message it is opt-in.
src/libsystemd/libsystemd.sym
src/libsystemd/sd-bus/bus-internal.h
src/libsystemd/sd-bus/sd-bus.c