Assume the following code where "sock" is a handle to TCP socket that was previously registered with an epoll file descriptor designated by epfd.
epoll_ctl(epfd, EPOLL_CTL_DEL, sock, &ev);
close(sock);
Is it still necessary to call epoll_ctl if the socket is going to get subsequently closed anyway? Or does the socket get implicitly deregistered as a result of closing it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…