python D-Bus: Introspection problem

Alban Crequy alban.crequy at collabora.co.uk
Sat Mar 15 09:05:57 PDT 2008


Hi,

I want to write a python application that receives all messages from
the bus for debugging purposes (like dbus-monitor in python). I use
add_match_string() and add_message_filter(). I don't export any
objects, but I request a name on the bus.

I monitor two Ruby applications: the first application exports an
object on the bus and the second application introspects the object of
the first application.

My problem is that the second application receives two replies for its
"Introspect" method: one from the first application (as I expected), and
one from the python monitoring application (I don't want this one).

I did not expect the python application to reply because the method
call is not addressed to it. But since it receives the method call
(because of my use of add_match_string), it replies to it, as shown by
theses logs:

method call sender=:1.166 -> dest=org.muadda.random
path=/org/muadda/random16;
interface=org.freedesktop.DBus.Introspectable; member=Introspect method

return sender=:1.164 -> dest=:1.166 reply_serial=4 string "<!DOCTYPE
node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> <node>
</node> "

method return sender=:1.165 -> dest=:1.166 reply_serial=4
   string "<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object
Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> <node>
<interface name="org.muadda.random">
<method name="suggest_random">
[...]

In this example, the python application replies quicker than the other
one, and the client thinks there is no methods exported :-(

How can I avoid this problem?

-- 
Alban


More information about the dbus mailing list