File tree Expand file tree Collapse file tree
examples/cpp/configuration Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -852,10 +852,10 @@ class CLIParser
852852 try
853853 {
854854 int input = std::stoi (argv[i]);
855- if (input < 1 || static_cast <long >(input) > static_cast <long >(max_duration))
855+ if (input < 0 || static_cast <long >(input) > static_cast <long >(max_duration))
856856 {
857857 throw std::out_of_range (" wait argument " + std::string (
858- argv[i]) + " out of range [1 , " + std::to_string (
858+ argv[i]) + " out of range [0 , " + std::to_string (
859859 max_duration) + " ]." );
860860 }
861861 else
Original file line number Diff line number Diff line change @@ -268,8 +268,8 @@ bool PublisherApp::publish()
268268 std::unique_lock<std::mutex> matched_lock (mutex_);
269269 cv_.wait (matched_lock, [&]()
270270 {
271- // at least one has been discovered
272- return ((matched_ > 0 ) || is_stopped ());
271+ // Publisher starts sending messages when enough entities have been discovered.
272+ return ((matched_ >= static_cast < int16_t >(wait_) ) || is_stopped ());
273273 });
274274 if (!is_stopped ())
275275 {
You can’t perform that action at this time.
0 commit comments