Request name question

Andre Magalhaes andrunko at gmail.com
Sun Nov 27 14:45:55 PST 2005


On 11/27/05, Havoc Pennington <hp at redhat.com> wrote:
> On Sun, 2005-11-27 at 19:15 -0300, Andre Magalhaes wrote:
> > I didn´t know about this :). What is the name the bus assigns for the
> > clients? Is it unique for each client. If so how can i know what is
> > this name when i want to send a message to the client (the service
> > name used to send a message). If not (the service name is the same for
> > all clients) we can just change the path to send a message.
>
> The bus assigns each client a unique name that is never re-used during
> the lifetime of the bus. This name is just an arbitrary string
> (right now it looks like ":1-20" for example)
>
> You can get this name from any message you receive from another app, it
> will be in the sender field of the message.
>
> Because this name is never re-used and cannot be spoofed, you can be
> sure that when the client disconnects you will get an error when you
> send to it. With a well-known name like "org.maemo.Tapioca.Client"
> you may accidentally send messages to a different client from the one
> you expected (because the name owner changes)
Hmm, nice, i didn´t know that.

> > Each client subscribes to the daemon and when the daemon receives a
> > message specific to that client it sends it directly to the correct
> > client. eg.: when the daemon receives a call for a specific client, it
> > just sends the incoming call message to this client. When the client
> > doesn´t want to receive more messages, it sends a unsubscribe message
> > to the daemon. I am sure this is not the best way to do it, but we
> > tried a lot of different configurations and this was one that works
> > ;).
>
> I would think you could just use the same object path for all clients,
> and the unique bus name for each client. I don't think you need a
> well-known name for your clients at all, do you? i.e. the
> "org.maemo.Tapioca.Client" does not seem needed to me.
Actually i will need to change the path name cause the same client can
subscribe more than once (different uris) to the daemon. I will use
the unique name and change just the path for now. Another idea??

Thanks again for the reply
Andrunko


More information about the dbus mailing list