Skip to content

Commit

Permalink
Fix DDS Late Joiners example (#2214)
Browse files Browse the repository at this point in the history
Signed-off-by: JLBuenoLopez-eProsima <[email protected]>
  • Loading branch information
JLBuenoLopez authored Sep 20, 2021
1 parent 7a354d1 commit 99291c8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions examples/C++/DDS/LateJoiners/latejoiners.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,10 @@ void latejoiners()
}

// Wait for volatile reader to match with writer, otherwise it may consider the new samples as historical
std::vector<InstanceHandle_t> matched_writers;
do
{
std::this_thread::sleep_for(std::chrono::milliseconds(100));
myReader2->get_matched_publications(matched_writers);
} while (matched_writers.empty());

// TODO(jlbueno) A condition variable that is notified when the reader has matched would be great
// Previously the example used not implemented API DataReader::get_matched_publications which is always returning
// RETCODE_UNSUPPORTED.
std::this_thread::sleep_for(std::chrono::milliseconds(500));

//Send 20 samples
std::cout << "Publishing 20 samples on the topic..." << std::endl;
Expand Down

0 comments on commit 99291c8

Please sign in to comment.