Targetted signals

Ross Burton ross at burtonini.com
Tue Jun 13 08:08:21 PDT 2006


On Wed, 2006-06-07 at 11:02 -0400, Havoc Pennington wrote:
> > 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)?
> > 
> 
> What does the current code do? I imagine we thought about this while 
> writing it, but I don't remember.

I finally got around to writing a minimal test application (attached).
This demonstrates that signals with a destination set are sent to all
clients.

ross at flashheart ~/Local/mess/24/dbus
$ ./listener &
[1] 11712
My bus address is :1.67
[ now the listener is waiting for signals to arrive ]
ross at flashheart ~/Local/mess/24/dbus
$ ./fire-signal
[ without an argument dbus_message_set_destination() isn't called ]
Sending signal
Got the signal
Sending signal
Got the signal
[ the listener got the signal ]
ross at flashheart ~/Local/mess/24/dbus
$ ./fire-signal :1.67
[ sending the signal to the address of the listener ]
Sending signal
Got the signal
Sending signal
Got the signal
[ the listener got the signal ]
ross at flashheart ~/Local/mess/24/dbus
$ ./fire-signal :1.3
[ sending the signal to Tomboy ]
Sending signal
Got the signal
Sending signal
Got the signal

I'd really like it if signals could be send to specific addresses.  My
use-case is the DBus port of evolution-data-server.  When a live book
view is updated a signal needs to be sent to interested parties, but as
there can be multiple book views with different queries and the message
arguments can be large (up to 40 vcards), restricting the sending of the
signals to only the relevant clients would be a good idea.  At the
moment the server calls methods on the server, but this causes a method
return to be sent, which is not required.

The alternative would be for each signal to have an ID argument and
clients filter on arg1=cookie, but argument matching is currently string
only.  If this were extended to ints then that might be a usable design.

Ross
-- 
Ross Burton                                 mail: ross at burtonini.com
                                          jabber: ross at burtonini.com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signaltest.tar.gz
Type: application/x-compressed-tar
Size: 826 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060613/6b7bc544/signaltest.tar.bin


More information about the dbus mailing list