Liveliness policy PreviousNext
Data Distribution Service (DDS) Forum > DDS Technical Forum >
Next message Kristofer H  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.

DDS::DataReaderQos readerQos;
m_subscriber->get_default_datareader_qos( readerQos );
DDS::Duration_t t = { 3, 0 };
readerQos.liveliness.lease_duration = t;
m_binary_Reader = static_cast<binary::binary_tdatareader>(m_subscriber->create_datareader( m_Sender_Topic,readerQos,this, mask, 0, false) );
Next message Kristofer H  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.

Back to top
Add Your Message Here
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Options: Post as "Anonymous"
Enable HTML code in message
Automatically activate URLs in message