34 const std::chrono::milliseconds interval;
36 bool thread_must_stop;
39 std::condition_variable condition;
47 while (!thread_must_stop)
49 condition.wait_for(lock, interval);
54 client.locked_ping(lock);
66 thread_must_stop(false),
69 if (interval.count() > 0)
72 thread = std::thread([
this](){keep_alive();});
82 thread_must_stop =
true;
84 condition.notify_one();
85 if (thread.joinable())
94 try {
stop();}
catch (...) {}