URBI tags are going to prove very useful for receiving incoming messages from the server: each command has an associated tag (notag by default), and this tag is transmitted in any message originating from this command. The UClient class handles the reception of those messages in an independent thread created by the constructor, parses them and fills a UMessage structure. Then, callback functions with the associated tag can be registered with the method setCallback: each time a message with this tag is sent by the server, the callback function will be called with the UMessage structure as a parameter.
typedef UCallbackAction (*UCallback) (const UMessage &msg); UCallbackID setCallback (UCallback cb, const char *tag)
The first parameter cb is a pointer to the function to call. The callback function must return URBI_CONTINUE, or URBI_REMOVE, in which case the function will be unregistered.
The best way to learn about how callbacks can be used with the liburbi is to look at some example, like the one described in the liburbi documentation page at: