Detect DDS inialization is complete

2 posts / 0 new
Last post
Last seen: 3 years 9 months ago
Joined: 02/14/2014
Posts: 41
Detect DDS inialization is complete

Is there a reliable way to detect when the DDS initialization is complete?  Our applications use DDS to report status.  We would like to wait for DDS to complete its initialization to the point where we can publish status before moving on to complete the rest of our initialization (which may take several seconds).

Gerardo Pardo's picture
Last seen: 3 months 3 weeks ago
Joined: 06/02/2010
Posts: 600

What do you mean by "completing initialization"? Do you mean complete the discovery process? Or is it something else?

If it is discovery then DDS performs continuous discovery, as new applications appear/dissapear from the network they are automatically discovered/forgotten. In addition there is no centralized "discovert service" so there is no obvious concept of having "discovered all the partitcipants" that are "present now".

For this reason instead of thinking about "completing" discovery it is typically more robust to just wait for the things you need. For example if you cannot proceed until a specific DataWriter or DataReader is discovered then you can use the builtin dicovery Topics to find out when those appear, or use the match notification statuses on the DataWriter/DataReader (e.g. the DatWriterListener::on_publication_matched() or the DataReaderListener::on_subscription_matched()) or even a direct call to DataReader::get_matched_publications() or DataWriter::get_matched_subscriptions())