<div dir="ltr"><div dir="ltr"><div dir="ltr">Yes, I did think about using interface name but not bus name.<div>But I am using 'dbus_connection_read_write(conn, 0);' to listen from client to send dbus command to bus name "conn" which I did request name for it. The server need always be in listening status from client. I can't know when client sending messages to process but need to use
dbus_connection_read_write routine to listen in a named bus connection. <br><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 4, 2018 at 9:00 PM <<a href="mailto:dbus-request@lists.freedesktop.org">dbus-request@lists.freedesktop.org</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Message: 4<br>
Date: Thu, 4 Oct 2018 19:56:54 +1300<br>
From: Lawrence D'Oliveiro <<a href="mailto:ldo@geek-central.gen.nz" target="_blank">ldo@geek-central.gen.nz</a>><br>
To: <a href="mailto:dbus@lists.freedesktop.org" target="_blank">dbus@lists.freedesktop.org</a><br>
Subject: Re: Re: Multiple connections to dbus-daemon in single<br>
appication<br>
Message-ID: <<a href="mailto:20181004195654.68d4d0d1@theon.geek-central.gen.nz" target="_blank">20181004195654.68d4d0d1@theon.geek-central.gen.nz</a>><br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
On Thu, 4 Oct 2018 15:30:52 +0900, dtdang wrote:<br>
<br>
> Could you give me example of how to register multiple distinct name to<br>
> application-bus-connection when connecting to dbus-daemon ?<br>
<br>
It’s easy. You can request the registration of any number of names on a<br>
single bus connection<br>
<<a href="https://dbus.freedesktop.org/doc/api/html/group__DBusBus.html" rel="noreferrer" target="_blank">https://dbus.freedesktop.org/doc/api/html/group__DBusBus.html</a>>. Then,<br>
when you receive a message, you call dbus_message_get_destination()<br>
<<a href="https://dbus.freedesktop.org/doc/api/html/group__DBusMessage.html#gaac65c926e6253e49aa689b4f032fad45" rel="noreferrer" target="_blank">https://dbus.freedesktop.org/doc/api/html/group__DBusMessage.html#gaac65c926e6253e49aa689b4f032fad45</a>><br>
to determine the exact name it was addressed to.<br>
<br>
You could dispatch your method-call handling based on the bus name the<br>
message was addressed to, but this is probably not a good idea; better<br>
to key your API calls off the interface name, not the bus name.<br>
************************************<br>
</blockquote></div></div></div></div></div>