-
Notifications
You must be signed in to change notification settings - Fork 223
Open
Description
int TcpClient::sendAndRecvTinyPb(const std::string& msg_no, TinyPbStruct::pb_ptr& res) {
bool is_timeout = false;
tinyrpc::Coroutine* cur_cor = tinyrpc::Coroutine::GetCurrentCoroutine();
auto timer_cb = [this, &is_timeout, cur_cor]() {
InfoLog << "TcpClient timer out event occur";
is_timeout = true;
this->m_connection->setOverTimeFlag(true);
tinyrpc::Coroutine::Resume(cur_cor);
};
TimerEvent::ptr event = std::make_shared<TimerEvent>(m_max_timeout, false, timer_cb);
m_reactor->getTimer()->addTimerEvent(event);
client的实现没有调用reactor的loop,这里添加的event fd没有被epoll监听,是不是不会被resume
Metadata
Metadata
Assignees
Labels
No labels