What am I doing wrong?

Tako Schotanus quintesse at palacio-cristal.com
Wed May 19 14:30:19 PDT 2004


Olivier Andrieu wrote:

> Tako Schotanus [Wed, 19 May 2004]:
> > 
> > I've got some code here (basically Amaury Jacquot's code with name 
> > changes) that compiles and starts but just doesn't seem te receive any 
> > messages. After starting it in one console window I enter:
> > 
> > dbus-send --system --dest='org.codejive.dbus.test' 
> > /org/codejive/dbus/test/Test org.codejive.dbus.test.Test.Boo
>
>Hmm, unless you've configured your system bus correctly, this won't
>work. The system bus has strict policy rules; by default it won't
>relay any message. See /etc/dbus-1/system.conf and man dbus-daemon-1.
>
>I'd use the session bus for testing.
>  
>
True, but I'm too lazy to set the new socket/pid in each of the windows
each time I restart the daemon so I just set the system.conf to be just
as promiscuous is the session.conf ;-)

> > On the other hand it might be that I just don't understand things 
> > correctly yet. Maybe I _need_ a service for example? And maybe therefore 
> > dbus-send can only be used as a "generic client"?
>
>There's some confusion here: dbus-send sends a signal TO
>org.codejive.dbus.test and client.c is set up to receive signals FROM
>org.codejive.dbus.test. Since this service does not exist anywhere,
>nothing happens.
>
>So, drop the 'sender=' part of the match rule.
>  
>
Ah, ok, I thought it had to be something like that. I must say I haven't
got the terminology quite straight yet and I must say it very difficult
to get all the relevant information form the docs on the website. I
couldn't find the specs for the match rule anywhere for example (the API
call yes, but not the rules themselves).

>Also here:
>	if (!dbus_connection_register_fallback(bus_conn, client_path, &client_vtable, NULL)) {
>		g_warning("Failed to register server object with the D-BUS bus daemon");
>		return -1;
>	}
>
>you're not registering anything with the daemon, this registration
>only concerns the (local) dispatch of messages, it is handled by the
>library. There is no communication with the dameon and the only way
>this can fail is because of OOM.
>  
>
Ok, like I said this is just copied code. I'm trying to get it to work
first and understand it later ;-)
But looking at it now I see you are right, the message does not have
anything to do with the call.

>Btw, the client/server naming of applications is a bit inappropriate
>when you're dealing with signals. Better terms are 'listener' and
>'emitter'. 
>
>  
>
True, but this is test code, so what's in a name? ;-)

Cheers ans thanks for your help!

-Tako




More information about the dbus mailing list