Repository navigation
|
大佬们,我想问一下,为什么要允许EPOLL_CTL_DEL的失败?EPOLL_CTL_DEL在何时会失败呢? void EPollPoller::update(int operation, Channel* channel)
{
struct epoll_event event;
memZero(&event, sizeof event);
event.events = channel->events();
event.data.ptr = channel;
int fd = channel->fd();
LOG_TRACE << "epoll_ctl op = " << operationToString(operation)
<< " fd = " << fd << " event = { " << channel->eventsToString() << " }";
if (::epoll_ctl(epollfd_, operation, fd, &event) < 0)
{
if (operation == EPOLL_CTL_DEL)
{
LOG_SYSERR << "epoll_ctl op =" << operationToString(operation) << " fd =" << fd;
}
else
{
LOG_SYSFATAL << "epoll_ctl op =" << operationToString(operation) << " fd =" << fd;
}
}
}
|
Answered by
chenshuo
Nov 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
在你提到的这个 commit 之前,是 66ec601
add curl example.因为
curl会自己先 close fd,再通知我们不再关注其上的 event,所以会出现 EPOLL_CTL_DEL 错误。为此只能不把 EPOLL_CTL_DEL 当致命错误。