Emitting signals

Lennart Poettering mzqohf at 0pointer.de
Wed Jul 27 21:05:24 EST 2005


Hi!

I am currently working on implementing a DBUS interface for the Avahi
mDNS stack (http://www.freedesktop.org/Software/Avahi). I have a few
questions on using DBUS:

Using Avahi DBUS clients may register mDNS services. These services
need to be automatically removed when the client which created them
terminates. If I understood correctly I can implement this by
listening to "NameOwnerChanged" signals, correct?

The state of these mDNS services may change during
lifetime. (i.e. REGISTERING -> CONFLICT, REGISTERING -> ESTABLISHED,
or similar) The client which registered them needs to be notified
about this. These notifactions need not to be handled and can happen
asynchronously. Therefore I thougt that DBUS signals are the way to go
for this. However, as it seems DBUS signals are usually broadcast to
all clients connected to the bus (at least dbus_message_new_signal()
doesn't have a "destination" parameter), which is something which
doesn't make sense in my situation since only one client should
recieve the notifcation. So I guess my design is flawed. Or isn't it?
Can I use dbus_message_set_destination() to specifiy the destination?

Only the client that created a service should be able to manipulate or
delete it. I need some simple access control for this. Is it OK to
simply strcmp() the sender string with the original sender string?
Ist it OK to return an DBUS_ERROR_ACCESS_DENIED error in this case?

Thank you,
      Lennart

-- 
name { Lennart Poettering } loc { Hamburg - Germany }
mail { mzft (at) 0pointer (dot) de } gpg { 1A015CC4 }  
www { http://0pointer.de/lennart/ } icq# { 11060553 }


More information about the dbus mailing list