Multiple connections to dbus-daemon in single appication

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Thu Oct 4 06:56:54 UTC 2018


On Thu, 4 Oct 2018 15:30:52 +0900, dtdang wrote:

> Could you give me example of how to register multiple distinct name to
> application-bus-connection when connecting to dbus-daemon ?

It’s easy. You can request the registration of any number of names on a
single bus connection
<https://dbus.freedesktop.org/doc/api/html/group__DBusBus.html>. Then,
when you receive a message, you call dbus_message_get_destination()
<https://dbus.freedesktop.org/doc/api/html/group__DBusMessage.html#gaac65c926e6253e49aa689b4f032fad45>
to determine the exact name it was addressed to.

You could dispatch your method-call handling based on the bus name the
message was addressed to, but this is probably not a good idea; better
to key your API calls off the interface name, not the bus name.


More information about the dbus mailing list