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);
|
fprintf(stderr, "New event %i for socket %i is EPOLLPRI\n", n, dcb->fd);
|
||||||
|
|
||||||
//#endif
|
//#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) {
|
if (events[n].events & EPOLLIN) {
|
||||||
// now checking the listening socket
|
// now checking the listening socket
|
||||||
if (dcb->state == DCB_STATE_LISTENING) {
|
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
|
} // filedesc loop
|
||||||
} // infinite loop
|
} // infinite loop
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user