|
@@ -45,23 +45,6 @@ namespace YA
|
|
//MsgFuncList.insert( std::make_pair( "beatheart", &web_connect::_beatheart_callback ) );
|
|
//MsgFuncList.insert( std::make_pair( "beatheart", &web_connect::_beatheart_callback ) );
|
|
|
|
|
|
__MsgFuncList.insert(std::make_pair("beatheart",&beatheart));
|
|
__MsgFuncList.insert(std::make_pair("beatheart",&beatheart));
|
|
-
|
|
|
|
- __wsclient.set_reconnect_attempts( 0 );
|
|
|
|
- using std::placeholders::_1;
|
|
|
|
- using std::placeholders::_2;
|
|
|
|
- using std::placeholders::_3;
|
|
|
|
- using std::placeholders::_4;
|
|
|
|
- sio::socket::ptr sock = __wsclient.socket();
|
|
|
|
- __recv_ping_time = 0;
|
|
|
|
- __connet_time = 0;
|
|
|
|
- __wsclient.set_open_listener( std::bind( &wsClient::_on_connected, this ) );
|
|
|
|
- __wsclient.set_close_listener( std::bind( &wsClient::_on_close, this, std::placeholders::_1 ) );
|
|
|
|
- __wsclient.set_reconnect_listener( std::bind( &wsClient::_on_reconnect, this, std::placeholders::_1, std::placeholders::_2 ) );
|
|
|
|
- __wsclient.set_fail_listener( std::bind( &wsClient::_on_fail, this ) );
|
|
|
|
- __wsclient.set_socket_open_listener( std::bind( &wsClient::_on_socket_opened, this ) );
|
|
|
|
-
|
|
|
|
- sock->on( JSON_CMD_VALUE_CALL, sio::socket::event_listener_aux( std::bind( &wsClient::_OnCallMessage, this, _1, _2, _3, _4 ) ) );
|
|
|
|
- sock->on( "code", sio::socket::event_listener_aux( std::bind( &wsClient::_OnLoginResponse, this, _1, _2, _3, _4 ) ) );
|
|
|
|
}
|
|
}
|
|
|
|
|
|
std::string wsClient::get_uri()
|
|
std::string wsClient::get_uri()
|
|
@@ -77,6 +60,27 @@ namespace YA
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ {
|
|
|
|
+ __wsclient.set_reconnect_attempts( 0 );
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ using std::placeholders::_1;
|
|
|
|
+ using std::placeholders::_2;
|
|
|
|
+ using std::placeholders::_3;
|
|
|
|
+ using std::placeholders::_4;
|
|
|
|
+ sio::socket::ptr sock = __wsclient.socket();
|
|
|
|
+ __recv_ping_time = 0;
|
|
|
|
+ __connet_time = 0;
|
|
|
|
+ __wsclient.set_open_listener( std::bind( &wsClient::_on_connected, this ) );
|
|
|
|
+ __wsclient.set_close_listener( std::bind( &wsClient::_on_close, this, std::placeholders::_1 ) );
|
|
|
|
+ __wsclient.set_reconnect_listener( std::bind( &wsClient::_on_reconnect, this, std::placeholders::_1, std::placeholders::_2 ) );
|
|
|
|
+ __wsclient.set_fail_listener( std::bind( &wsClient::_on_fail, this ) );
|
|
|
|
+ __wsclient.set_socket_open_listener( std::bind( &wsClient::_on_socket_opened, this ) );
|
|
|
|
+
|
|
|
|
+ sock->on( JSON_CMD_VALUE_CALL, sio::socket::event_listener_aux( std::bind( &wsClient::_OnCallMessage, this, _1, _2, _3, _4 ) ) );
|
|
|
|
+ sock->on( "code", sio::socket::event_listener_aux( std::bind( &wsClient::_OnLoginResponse, this, _1, _2, _3, _4 ) ) );
|
|
|
|
+ }
|
|
|
|
+
|
|
__wsclient.connect( __uri );
|
|
__wsclient.connect( __uri );
|
|
|
|
|
|
std::cv_status status = std::cv_status::timeout;
|
|
std::cv_status status = std::cv_status::timeout;
|