|
@@ -193,6 +193,8 @@ namespace YA
|
|
|
|
|
|
void wsClient::_OnCallMessage( std::string const& name, sio::message::ptr const& data, bool need_ack, sio::message::list &ack_resp )
|
|
|
{
|
|
|
+ log_info("web-message:%s",data->get_string().c_str());
|
|
|
+
|
|
|
if ( data->get_flag() == sio::message::flag_object )
|
|
|
{
|
|
|
std::string cmd = data->get_map()[JSON_ROOT_KEY_CMD]->get_string();
|
|
@@ -201,7 +203,22 @@ namespace YA
|
|
|
mit_func = __MsgFuncList.find( cmd );
|
|
|
if ( mit_func != __MsgFuncList.end() )
|
|
|
{
|
|
|
- mit_func->second( GetID(), name, data, need_ack, ack_resp );
|
|
|
+ try
|
|
|
+ {
|
|
|
+ mit_func->second( GetID(), name, data, need_ack, ack_resp );
|
|
|
+ }
|
|
|
+ catch(const std::exception&e)
|
|
|
+ {
|
|
|
+ log_error("捕获到异常:%s",e.what());
|
|
|
+ }
|
|
|
+ catch(...)
|
|
|
+ {
|
|
|
+ log_error("捕获到未知异常");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ log_error("web-message没有找到对应的处理函数:%s",data->get_string().c_str());
|
|
|
}
|
|
|
|
|
|
__recv_ping_time = time(0);
|