posted on Wednesday, December 09, 2009 - 09:04 am
I'm having trouble when trying to use the liveliness QoS for a reader. What I'm trying to accomplish is to determine if a publisher on a specific topic is available or not. When starting my application I need to know if there is a publisher available or not, during the life-time of my application I also need to be notified if a publisher joins the data-bus, and when it leaves.
Im trying to set the readerQos.liveliness.lease_duration in order to periodically check the liveliness of the writer, but when adding this parameter to the readerQos I get no liveliness notifications at all, neither does on_data_available get called. When removing the liveliness lease_time on_data_available and on_liveliness_changed gets called. on_liveliness_changed is called on startup, but nothing when the publisher exits.
posted on Wednesday, December 16, 2009 - 07:55 am
I had to add the same liveliness QoS for the writer in order to get a callback, so all thou I haven't tried it yet, there is probably a way of reading if the requested QoS could be supplied by the corresponding writer or not.
In the on_liveliness_changed callback method i evaluated the alive_count data.