Runing the loop
#define EVLOOP_ONCE 0x01
#define EVLOOP_NONBLOCK 0x02
#define EVLOOP_NO_EXIT_ON_EMPTY 0x04
#define EVLOOP_NONBLOCK 0x02
#define EVLOOP_NO_EXIT_ON_EMPTY 0x04
int event_base_loop(struct event_base *base, int flags);
int event_base_dispatch(struct event_base *base);
Stoping the loop
int event_base_loopexit(struct event_base *base,
const struct timeval *tv);
const struct timeval *tv);
int event_base_loopbreak(struct event_base *base);
int event_base_got_exit(struct event_base *base);
int event_base_got_break(struct event_base *base);
Re-checking for events
int event_base_loopcontinue(struct event_base *);
其他
//获取时间,而不使用耗时的系统调用
int event_base_gettimeofday_cached(struct event_base *base,
struct timeval *tv_out);
int event_base_update_cache_time(struct event_base *base);
//打印当前event_base的事件集合及其状态
void event_base_dump_events(struct event_base *base, FILE *f);
//在所有的event上运行函数
typedef int (*event_base_foreach_event_cb)(const struct event_base *,
const struct event *, void *);
int event_base_foreach_event(struct event_base *base,
const struct event *, void *);
int event_base_foreach_event(struct event_base *base,
event_base_foreach_event_cb fn, void *arg);