#pragma once #include #include class Connection; class WatchdogThread : std::enable_shared_from_this { Connection& connection_; boost::asio::steady_timer timer_; bool tried_ping; auto on_activity() -> void; auto timeout_token(); auto on_timeout() -> void; auto on_connect() -> void; auto on_disconnect() -> void; public: WatchdogThread(Connection& connection); static auto start(Connection& connection) -> void; };