Sending DBUS signals without glib mainloop

Ikke eikke@eikke.com
Tue Jan 11 06:33:21 PST 2005


On Tue, 2005-01-11 at 12:42 +0100, Ikke wrote:
> ...

Hmm... Seems to be some glib-related thing, *or* me understanding
nothing of low-level DBUS stuff.

I checked the code samples in Ross' IBM article (dbus-ping-send and
dbus-ping-listen). Apart from one little error (need a dbuserror in the
filter call), they compiled fine and guess what: they worked. I could
see ping signals in dbus-monitor, and the listener was able to pick them
up.

So I decided to do something similar. I created one sources file very
similar to Ross' sender [1], and another one without the glib mainloop
[2]. A diff is attached to this email.

This is what I get in dbus-monitor when the glib version is executed:

signal interface=org.freedesktop.DBus; member=ServiceCreated;
sender=org.freedesktop.DBus
string::1.24
method call interface=org.freedesktop.DBus; member=Hello; sender=:1.24
error name=org.freedesktop.DBus.Error.AccessDenied;
sender=org.freedesktop.DBus
string:A security policy in place prevents this recipient from receiving
this message from this sender, see message bus configuration file
(rejected message had interface "(unset)" member "(unset)" error name
"org.freedesktop.DBus.Error.UnknownMethod" destination ":1.24" reply
serial 1 requested_reply=0)
signal interface=com.eikke.test.ping; member=Ping; sender=:1.24
string:test

Which is what I want it to display (next to the AccessDenied stuff, but
well, the signal is transmitted)

Now if I run the "plain" version, I get this:

signal interface=org.freedesktop.DBus; member=ServiceDeleted;
sender=org.freedesktop.DBus
string::1.24
signal interface=org.freedesktop.DBus; member=ServiceCreated;
sender=org.freedesktop.DBus
string::1.25
method call interface=org.freedesktop.DBus; member=Hello; sender=:1.25
error name=org.freedesktop.DBus.Error.AccessDenied;
sender=org.freedesktop.DBus
string:A security policy in place prevents this recipient from receiving
this message from this sender, see message bus configuration file
(rejected message had interface "(unset)" member "(unset)" error name
"org.freedesktop.DBus.Error.UnknownMethod" destination ":1.25" reply
serial 1 requested_reply=0)
signal interface=org.freedesktop.DBus; member=ServiceDeleted;
sender=org.freedesktop.DBus
string::1.25


Which means from my non-glib version, nothing is sent. I have no clue
what could cause this: is it my own code thats wrong somewhere? Do I
miss a step?...

Please let me know how to fix this. I can work further now using the
glib code, but working without glib deps would be nicer :-)


Regards, Ikke

[1] http://code.eikke.com/index.php?dir=test/&file=senddbussignal-glib.c
[2] http://code.eikke.com/index.php?dir=test/&file=senddbussignal.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus-glib-test.diff
Type: text/x-patch
Size: 894 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20050111/a9239c66/dbus-glib-test.bin


More information about the dbus mailing list