-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
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
loop 问题 #106
Comments
handy支持优雅退出,方便使用工具检查内存泄漏问题 |
loop_once(0); 这个是epoll_wait 的超时时间为0 超时时间等于零导致epoll_wait 立即返回,即使没有可用事件 这个是用于干嘛? 清理资源? |
还有 一个疑问就是 loop 的时候 loop_once(10000); 没退出的时候 epoll_wait 没事件 会阻塞下面的clear() 直到 有事件到 才会clear 这样为什么要等有事件 才clear.. |
loop_once(0)会进行连接的IO处理,因为前面的处理中,可能会关闭了一部分连接,因此需要loop_once进行清理 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
你好 问一个问题
void EventsImp::loop() {
while (!exit_)
loop_once(10000);
timerReps_.clear();
timers_.clear();
idleConns_.clear();
for (auto recon : reconnectConns_) { //重连的连接无法通过channel清理,因此单独清理
recon->cleanup(recon);
}
loop_once(0);
}
为什么要 while (!exit_)
loop_once(10000); 和 loop_once(0);
The text was updated successfully, but these errors were encountered: