How to chek the presence of an object on dbus

tomw tomw at ubilix.com
Mon Aug 30 23:23:12 PDT 2010


Thanks, sometimes it's the most obvious things that help...

cheers,

tomw


On Tue, 2010-08-31 at 08:01 +0200, Thiago Macieira wrote:
> On Tuesday 31. August 2010 07.32.07 Rémi Denis-Courmont wrote:
> > Le mardi 31 août 2010, tomw a écrit :
> > > I was wondering how to check the presence of an object on the dbus
> > > the most elegant way. Of course, one could create a proxy object on
> > > the path and call the Introspect method. If this returns proper
> > > introspect data the object is available. However, are there any
> > > better ways?
> > 
> > Objects are not present "on the bus". They are instantiated in ways
> > specific to DBus client process, or at least its DBus implementation.
> > 
> > Not all DBus clients implement introspection. And even when they do
> > implement it (correctly), there is no race-free nor poll-free way to be
> > notified of objects tree changes.
> > 
> > 
> > In my opinion, the most "elegant" way to check that an object exists is
> > to query it. This is interface-specific, but you should know what you
> > are talking with anyway.
> 
> Rémi is correct.
> 
> The most elegant way to check if an object exists is to use it as if it 
> existed. If it exists, your operation will work. If it doesn't exist, you'll 
> get an error indicating that it doesn't.
> 
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus




More information about the dbus mailing list