mirror of
https://github.com/eclipse-paho/paho.mqtt.cpp.git
synced 2025-09-15 12:58:39 +08:00
#528 Backed out the connect wait to keep testing publish-before-connect
This commit is contained in:
parent
2b8bfbb94e
commit
c8aabb5d82
@ -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;
|
||||
@ -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));
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user