-----BEGIN PGP SIGNED MESSAGE-----
> Can you do all this in your driver's Setup()? At that point, the
> is filled, and you can happily walk through it.
The problem with that is that Setup is only called when a client
subscribes, and there is no client interface to this device.
> Btw, if you specify
> "alwayson 1" as an option to the device in the config file, it will be
> subscribed when the server starts (but after the deviceTable is
> filled); you
> can do this for any device.
This should fix that problem though. Can I manually set that in my
driver, rather than putting it in the config file each time? (OK, I'll
> Btw, how will the name server work?
Here is how libservicediscovery works, for anyone who is interested. I
have uploaded a tarball with the library source code and some info here:
Libservicediscovery (LSD) sends and responds to queries. Typically
these are broadcast via UDP to the local network, but you can also set
specific hosts and ports to open TCP connections to, and set some
options to relay between the two transport mechanisms.
A query is four regular expressions: title, description, types and url.
In the Player device I call the title "name" (the robot name), and I
call types "tags". To advertise a service you add its four strings to
an instance of the ServiceDirectory class. You also call methods on
ServiceDirectory to make queries and to service incoming queries. If
any incoming query matches a service you have added, a response is sent.
The way you would use it with Player is to add a "service_adv" it to
your config file (with driver "lsd") or to the Stage world file. You
can set the name, description and tags of the service, and you can
override the URL as well. Also, any other devices on the robot will be
added to the "tags" (types) list like this:
"device:laser(sicklms200)". Then if your client is looking for all
robots with a laser, it does:
sd.query("device:laser(.*)", "", "", "", callback)
Or if it is looking for a robot named "Robbie", it could do:
sd.query("", "Robbie", "", "", callback);
Then, in some loop or callback somewhere, it does:
Above, 'callback' is an instance of a subclass of
ServiceAdvertisementListener. It contains a virtual method
notifyNewService which is passsed an id (integer returned from query),
and a Service struct containing the title, description, types and url
of the service that was found.
I also wrote a simple "service_responder" program which just runs
programs when it recieves responses to associated queries. I use this
to just run a set of clients for every robot that comes online.
My summer research project is to evaluate some interfaces for working
with lots of robots (10-20 to start with, maybe more as time goes on),
a) It's quite tedious to run (3 to 5) X (10 to 20) clients by hand and
even by script
b) I need to run clients on more than one workstation
c) I will be making sure that the system holds up under at least that
many clients, maybe more. It's a VERY lightweight protocol, and
messages are only sent for queries, replies, and new services, so there
really isn't danger of flooding your network at all unless you put a
query in a busyloop or something foolish like that :)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (Darwin)
-----END PGP SIGNATURE-----