Targetted signals

Daniel P. Berrange dan at
Wed Jun 7 08:18:31 PDT 2006

On Wed, Jun 07, 2006 at 03:37:47PM +0100, Ross Burton wrote:
> Hi,
> This has come up before but I don't think there was a good resolution to
> it, and now that DBus 1.0 is drawing closer I think it needs a good
> answer.  Can signals be send to a specific address, or are they always
> broadcast to all interested parties?
> For example, if :1.2 and :1.3 both have relevant matchers to receive
> this signal:
>   message = dbus_message_new_signal ("/foo", "FooInterface", "Bar");
> Will doing this:
>   dbus_message_set_destination (message, ":1.2");
> Cause the signal to be sent to both :1.2 and :1.3 (destination is
> ignored, signals are sent to all interested clients), or just :1.2?
> (destination if set is respected)?

Actually I think if you set an explicit destination on the signal it will
do the right thing - ie unicast to that recipient only.

The only problems I remember having with setting an explicit destinations

 * In the context of method calls - you can set a destination to be a
   well known bus name (org.example.blah), but it wouldn't let me set a
   destination based on unique name (:1.2). 

 * Signal match rules - you can register a match rule based  on a unique
   bus name (:1.2), but not one based ona well known bus name 

So if the owner of a well known name gets replaced, your method calls
will suddenly go to the new destination, but your signals will be refering
to the old destination....

|=-            GPG key:       -=|
|=-       Perl modules:              -=|
|=-           Projects:               -=|
|=-   berrange at  -  Daniel Berrange  -  dan at    -=|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url :

More information about the dbus mailing list