Welcome! Log In Create A New Profile

Advanced

Why does ngx_epoll_del_event use EPOLL_CTL_MOD

Qiying Wang
October 28, 2019 03:52AM
Sorry for bothering you.

I think I've made it clear.

Because there's another function ngx_epoll_add_connection which add an
event combined with EPOLLIN & EPOLLOUT. If using ngx_epoll_del_event on
this kind of event it cannot just use EPOLL_CTL_DEL, in which way both the
read and write will be delete. That's why the EPOLL_CTL_MOD was used here.

There's another piece of code in the ignored parts of the code I previously
quoted. Which means when deleting a read event, set it to write event and
modify it, while when deleting a write event, set it to read event and
modify it.

if (event == NGX_READ_EVENT) {
e = c->write;
prev = EPOLLOUT;

} else {
e = c->read;
prev = EPOLLIN|EPOLLRDHUP;
}
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Why does ngx_epoll_del_event use EPOLL_CTL_MOD

Qiying Wang 49 October 28, 2019 03:52AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 88
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready