DbusProxyObj.listNames(); help

4 posts / 0 new
Last post
DbusProxyObj.listNames(); help
Tiago's picture
Offline
Joined
04/04/2011 - 09:58
Posted
Mon, 09/05/2011 - 17:36

Hi

Is there any way to dicover remote well-known names without being connected to any service?

thanks

Re: DbusProxyObj.listNames(); help
Nikhil Dabhade Moderator
Nikhil Dabhade's picture
Offline
Joined
01/27/2011 - 17:39

Hi Tiago,

To discover all the well known names being advertised you need to search for "*" which means that search for all the available names.

Call FindAdvertisedName with name that you are looking for as "*" or even "".

This does not require connection to any service whatsover since this is a part of the discovery mechanism.

Regards,
Nikhil 

Re: DbusProxyObj.listNames(); help
will's picture
Offline
Joined
04/04/2011 - 09:22

 

How do I get a list (String[] names) of these available names? 

 

Re: DbusProxyObj.listNames(); help
Nikhil Dabhade Moderator
Nikhil Dabhade's picture
Offline
Joined
01/27/2011 - 17:39

Hi will,

Are you using Java or C++ ? 

Look up FindAdvertisedName function. Here you pass in  "*" as the name you are looking for.

There is a callback called FoundAdvertisedName which is called everytime the client's daemon finds a match for the name the client was looking for.

So to get a list available names "being advertised" the callback is called for everyname.

If you just want the names that are registered on your daemon you can call listNames that will return a list of names that are registered on the bus.

Nikhil