|
@@ -249,18 +249,9 @@ void Communication_socket_base::receive_data_thread(Communication_socket_base* c
|
|
if ( t_receive_string.length()>0 )
|
|
if ( t_receive_string.length()>0 )
|
|
{
|
|
{
|
|
//如果这里接受到了消息, 在这提前解析消息最前面的Base_msg (消息公共内容), 用于后续的check
|
|
//如果这里接受到了消息, 在这提前解析消息最前面的Base_msg (消息公共内容), 用于后续的check
|
|
- std::cout<<" recieve length "<<t_receive_string.length()<<std::endl;
|
|
|
|
message::Base_msg t_base_msg;
|
|
message::Base_msg t_base_msg;
|
|
if( t_base_msg.ParseFromString(t_receive_string) )
|
|
if( t_base_msg.ParseFromString(t_receive_string) )
|
|
{
|
|
{
|
|
- std::cout<<" TYPE ==== "<<t_base_msg.base_info().msg_type()<<std::endl;
|
|
|
|
-
|
|
|
|
- message::Measure_response_msg response;
|
|
|
|
- if(response.ParseFromString(t_receive_string))
|
|
|
|
- std::cout<<response.DebugString()<<std::endl;
|
|
|
|
- else
|
|
|
|
- std::cout<<" response EROR************************"<<std::endl;
|
|
|
|
-
|
|
|
|
//第一次解析之后转化为, Communication_message, 自定义的通信消息格式
|
|
//第一次解析之后转化为, Communication_message, 自定义的通信消息格式
|
|
Communication_message * tp_communication_message = new Communication_message;
|
|
Communication_message * tp_communication_message = new Communication_message;
|
|
tp_communication_message->reset(t_base_msg.base_info(), t_receive_string);
|
|
tp_communication_message->reset(t_base_msg.base_info(), t_receive_string);
|
|
@@ -289,7 +280,6 @@ void Communication_socket_base::receive_data_thread(Communication_socket_base* c
|
|
tp_communication_message = NULL;
|
|
tp_communication_message = NULL;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
//解析失败, 就当做什么也没发生, 认为接收消息无效,
|
|
//解析失败, 就当做什么也没发生, 认为接收消息无效,
|
|
}
|
|
}
|