EPOLLER | EPOLLHUP moved at the begininning of the loop
This commit is contained in:
@ -242,6 +242,14 @@ int main(int argc, char **argv) {
|
||||
fprintf(stderr, "New event %i for socket %i is EPOLLPRI\n", n, dcb->fd);
|
||||
|
||||
//#endif
|
||||
if (events[n].events & (EPOLLERR | EPOLLHUP)) {
|
||||
fprintf(stderr, "CALL the ERROR pointer\n");
|
||||
(dcb->func).error(dcb, events[n].events);
|
||||
|
||||
// go to next event
|
||||
continue;
|
||||
}
|
||||
|
||||
if (events[n].events & EPOLLIN) {
|
||||
// now checking the listening socket
|
||||
if (dcb->state == DCB_STATE_LISTENING) {
|
||||
@ -262,11 +270,6 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
if (events[n].events & (EPOLLERR | EPOLLHUP)) {
|
||||
fprintf(stderr, "CALL the ERROR pointer\n");
|
||||
(dcb->func).error(dcb, events[n].events);
|
||||
}
|
||||
|
||||
} // filedesc loop
|
||||
} // infinite loop
|
||||
|
||||
|
Reference in New Issue
Block a user