Sending Signals (and possibly a BUG????)
Olivier Andrieu
oliv__a at users.sourceforge.net
Thu Apr 22 03:31:36 EST 2004
mahir at softhome.net [Wed, 21 Apr 2004]:
> Also please answer the actual query in which I had asked about
> capturing signals, the server is able to capture a message of type
> method call but not a signal, do we need some rule matching to
> catch the signals..
In your code (in client.c), you send a signal but do not set the
destination field with dbus_message_set_destination. In this case, the
bus will send the message to all connected applications that have set
a match rule matched by this signal. So, you need to either:
- modify client.c by adding a
dbus_message_set_destination (message, "the_service_owned_by_your_server");
only the designated service will receive this signal.
- modify server.c so that it adds a match rule, e.g :
dbus_bus_add_match (connection, "type='signal',path='/your/object'")
Also, do not use dbus_message_set_sender in the client, this intended
for the bus. (And indeed there was a bug).
--
Olivier
More information about the dbus
mailing list