本文整理汇总了C++中ObPacket::get_source_timeout方法的典型用法代码示例。如果您正苦于以下问题:C++ ObPacket::get_source_timeout方法的具体用法?C++ ObPacket::get_source_timeout怎么用?C++ ObPacket::get_source_timeout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObPacket
的用法示例。
在下文中一共展示了ObPacket::get_source_timeout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: do_request
int MockMergeServer::do_request(ObPacket * base_packet)
{
ObPacket * packet = base_packet;
int32_t packet_code = packet->get_packet_code();
int ret = OB_SUCCESS;
ret = packet->deserialize();
int64_t receive_time = packet->get_receive_ts();
int32_t version = packet->get_api_version();
int32_t channelId = packet->getChannelId();
tbnet::Connection *connection = packet->get_connection();
ObDataBuffer *in_buff = packet->get_buffer();
ThreadSpecificBuffer::Buffer *thread_buff = response_packet_buffer_.get_buffer();
//貌似刨去了网络时间?
int64_t timeout_us = packet->get_source_timeout() - (tbsys::CTimeUtil::getTime() - packet->get_receive_ts());
if (NULL != thread_buff)
{
thread_buff->reset();
ObDataBuffer out_buff(thread_buff->current(), thread_buff->remain());
if (OB_SUCCESS == ret)
{
switch(packet_code)
{
case OB_SCAN_REQUEST:
ret = ms_scan(receive_time, version, channelId, connection, *in_buff, out_buff, timeout_us);
if (ret != OB_SUCCESS)
{
TBSYS_LOG(WARN, "ms_scan failed");
}
break;
}
}
}
return ret;
}