I'm not sure if I'm understanding this part of your question "only by setting the EV_TIMEOUT
option. The rest of it, I think I am able to answer for you.
There is a way that you can check to see if the timeout event caused the event to return to the callback.
Let's say your callback prototype looks like this
(evutil_socket_t fd, short what, void *arg)
Then you can check for a timeout on the fd
by doing: (what&EV_TIMEOUT)
The relevant types are defined in <event2/event.h>
.
In case this doesn't answer your question, you can find a lot of relevant info here, for example: http://www.wangafu.net/~nickm/libevent-book/Ref4_event.html