dbus object path
thiago at kde.org
Sat Mar 14 10:41:56 PDT 2009
Michael 'Mickey' Lauer wrote:
>Am Dienstag, den 10.03.2009, 14:38 +0300 schrieb Alexandr Lebedev:
>> Dear colleagues. Help me please. How I can receive the list of objects
>> under the service name?
>This is one of the missing features in dbus. You need to use
>introspection. Have a look at dbus-hlid @ http://git.freesmartphone.org
>which you can use for that.
No, you don't. Please read my email: unless you're writing a program whose
purpose is to scan existing objects in D-Bus and show them to the user
(i.e., a program that *is* a D-Bus browser), finding objects through
introspection is always the wrong solution.
The correct thing is to:
1) know the path before-hand (via well-known path) or out-of-band
or 2) request that the object reveal itself via signalling (one signal
request, one reply or method call)
I have taken a look at http://git.freesmartphone.org/?p=dbus-
hlid.git;a=blob;f=src/obj.vala;hb=HEAD and I can tell that it probably
works, but it is WRONG. Please do not introspect every object in a
service. That's a lot of round-trips for what you could do with two (#2
above) or zero (#1).
Not to mention, of course, that some services do not like being
introspected at all and may not reply, thus causing your code to hang for
25 seconds while calling to /.
Also, you didn't use a proper XML parser. Some services may reply with
introspections containing no new-lines, for instance, or with different
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freedesktop.org/archives/dbus/attachments/20090314/c95381d7/attachment.pgp
More information about the dbus