You have a couple of ways to go.
If you are using
EPOLLET
(edge-triggered), then your event handler on wake-up can first check if you are in the middle of handling typed input from the console. If so, it can just not read anything, but set a flag. When the typed input handler is done, it checks that flag, and manually wakes up the socket input handler to handle the data.If you are using level-triggered instead, then you can suppress th event by modifying the event set for that file descriptor to suppress the events you want to ignore. This can either be by using
EPOLL_CTL_MOD
with a new set of events, or by usingEPOLL_CTL_DEL
to unregister the file descriptor fromepoll
altogether. You would add back what was suppressed after you are finished with the typed input handler.