|
@@ -166,22 +166,17 @@ namespace YA
|
|
|
|
|
|
void wsClientMgr::Reconnect(std::shared_ptr<wsClient> & ws)
|
|
|
{
|
|
|
- if (nullptr != ws)
|
|
|
- {
|
|
|
-// std_info("wsClinet Reconnect : id[%d],url[%s]", ws->GetID(), ws->get_uri().c_str());
|
|
|
- log_info("wsClinet Reconnect : id[%d],url[%s]", ws->GetID(), ws->get_uri().c_str());
|
|
|
-
|
|
|
- std::shared_ptr<wsClient> pClient = std::make_shared<wsClient>();
|
|
|
- pClient->init( ws->GetID(), ws->get_uri(), ws->__MsgFuncList );
|
|
|
+ if (nullptr == ws)
|
|
|
+ return;
|
|
|
|
|
|
- ws=pClient;
|
|
|
+ ws=ws->clone();
|
|
|
+ log_info("wsClinet Reconnect : id[%d],url[%s]", ws->GetID(), ws->get_uri().c_str());
|
|
|
|
|
|
- if (ws->connect() == 0)
|
|
|
- {
|
|
|
- ws->login();
|
|
|
- log_info("wsClinet Reconnect : id[%d],url[%s] Success.", ws->GetID(), ws->get_uri().c_str());
|
|
|
-// std_info("wsClinet Reconnect : id[%d],url[%s] Success.", ws->GetID(), ws->get_uri().c_str());
|
|
|
- }
|
|
|
+ if (ws->connect() == 0)
|
|
|
+ {
|
|
|
+ ws->login();
|
|
|
+ log_info("wsClinet Reconnect : id[%d],url[%s] Success.", ws->GetID(), ws->get_uri().c_str());
|
|
|
+// std_info("wsClinet Reconnect : id[%d],url[%s] Success.", ws->GetID(), ws->get_uri().c_str());
|
|
|
}
|
|
|
}
|
|
|
|