1.Use std::move to initialize std::thread; 2.Fix thread cannot exit error

This commit is contained in:
dijunkun
2024-06-13 15:46:05 +08:00
parent eee3b2a95e
commit c575a9170c
14 changed files with 48 additions and 39 deletions

View File

@@ -53,8 +53,8 @@ class WsCore {
private:
client m_endpoint_;
websocketpp::connection_hdl connection_handle_;
websocketpp::lib::shared_ptr<websocketpp::lib::thread> m_thread_;
websocketpp::lib::shared_ptr<websocketpp::lib::thread> ping_thread_;
std::thread m_thread_;
std::thread ping_thread_;
WsStatus ws_status_ = WsStatus::WsClosed;
int timeout_count_ = 0;