We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
看到tcp接收数据的模块。首先新的TCP连接进来,TcpAccepter会接受该连接,然后调用TcpAcceptor :: AddEvent()函数将其加入到一个负载最低的EventLoop中,在EventLoop :: AddEvent()将该文件句柄加入到m_oFDQueue之后,是否需要调用EventLoop :: JumpoutEpollWait()函数以通知EventLoop尽快将队列中的fd加入到epoll中,否则需要等到下一次超时后才能处理。
因此将EventLoop::AddEvent()改为如下是否较为合适: void EventLoop :: AddEvent(int iFD, SocketAddress oAddr) { std::lock_guardstd::mutex oLockGuard(m_oMutex); m_oFDQueue.push(make_pair(iFD, oAddr));
//新添加行 JumpoutEpollWait(); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
看到tcp接收数据的模块。首先新的TCP连接进来,TcpAccepter会接受该连接,然后调用TcpAcceptor :: AddEvent()函数将其加入到一个负载最低的EventLoop中,在EventLoop :: AddEvent()将该文件句柄加入到m_oFDQueue之后,是否需要调用EventLoop :: JumpoutEpollWait()函数以通知EventLoop尽快将队列中的fd加入到epoll中,否则需要等到下一次超时后才能处理。
因此将EventLoop::AddEvent()改为如下是否较为合适:
void EventLoop :: AddEvent(int iFD, SocketAddress oAddr)
{
std::lock_guardstd::mutex oLockGuard(m_oMutex);
m_oFDQueue.push(make_pair(iFD, oAddr));
//新添加行
JumpoutEpollWait();
}
The text was updated successfully, but these errors were encountered: