
每次EPOLLIN事件都会带一次EPOLLOUT事件

我注册事件有:EPOLLIN | EPOLLOUT | EPOLLET | EPOLLRDHUP

ET模型下不是缓冲区由写变为不可写的时篖LOUT才返回乱这富是总是返回的,而是有EPOLLIN 的时横带一次。man手册里面那样说

When used as an edge-triggered interface, for performance reasons, it is possible to add the file descriptor inside the epoll interface (EPOLL_CTL_ADD) once by specifying (EPOLLIN|EPOLLOUT). This allows you to avoid continuously switching between EPOLLIN and EPOLLOUT calling epoll_ctl(2) with EPOLL_CTL_MOD.

实际跑过,没有鱼说的可读时也是OUT事件的形成。在注册上之胡生了一次EPOLLOUT,之夯有当不可写变为可写时,才造成EPOLLOUT。我这边实际当中还已英不厨需要EPOLLOUT的情形。通常是我应芝发,才MOD EPOLLOUT,芝发epollout事件,然篹nd/write。
这糕都话最好取看man手册epollout事件,
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-136375-1.html
真的好听