Emitting signals

Lennart Poettering mzqohf at 0pointer.de
Wed Jul 27 22:21:09 EST 2005


On Wed, 27.07.05 13:11, Ross Burton (ross at burtonini.com) wrote:

> > 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?
> 
> Yes, signals are broadcast to all clients.  I'd suggest either sending
> the signals and make the client filter the signals itself.  My app
> solves this by sending normal messages to the client, but I can do this
> as I've got a client library which handles the incoming messages and
> transforms them into GObject signals for the applications.

Isn't this a waste of resources? You're spamming all DBUS clients
with signals only one client might be interested in, arent' you? If
hundreds of clients are connected to the bus (which is easily
possible, since avahi uses the system bus), you'll wake up all clients
for nothing.

Lennart

-- 
Lennart Poettering; lennart [at] poettering [dot] de
ICQ# 11060553; GPG 0x1A015CC4; http://0pointer.de/lennart/


More information about the dbus mailing list