Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
epoll TCP 与 EPOLLOUT | 即使我在收到第一个事件后发送数据,EPOLLET 也会收到一次事件并超时。
而在 UDP 中,epoll 在发送新数据后不断收到 EPOLLOUT 事件。
你能解释一下这个问题吗?
EPOLLET 是边沿触发模式,这意味着它只会通知您状态转换。在这种情况下,它会在文件描述符从不可写变为可写时通知您。使其不可写的唯一方法是填充传出缓冲区。所以你只需要继续发送直到你得到EAGAIN,然后你会等待通知。