Skip to content

Commit

Permalink
#528 Backed out the connect wait to keep testing publish-before-connect
Browse files Browse the repository at this point in the history
  • Loading branch information
fpagliughi committed Jan 5, 2025
1 parent 2b8bfbb commit c8aabb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/async_publish_time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ int main(int argc, char* argv[])
// Note that we start the connection, but don't wait for completion.
// We configured to allow publishing before a successful connection.
cout << "Starting connection..." << endl;
cli.connect(connOpts)->wait();
cli.connect(connOpts);

auto top = mqtt::topic(cli, "data/time", QOS);
cout << "Publishing data..." << endl;
Expand All @@ -151,7 +151,7 @@ int main(int argc, char* argv[])
this_thread::sleep_for(SAMPLE_PERIOD);

t = timestamp();
// cout << t << endl;

if (abs(int(t - tlast)) >= DELTA_MS)
top.publish(to_string(tlast = t));

Expand Down

0 comments on commit c8aabb5

Please sign in to comment.