struct event_base* event_base_new(void);
event_base_free(struct event_base* base);
event_base_dispatch(struct event_base* base);
const char **event_get_supported_methods();
const char * event_base_get_method(const struct event_base *base);
int event_reinit(struct event_base * base)
#define EV_TIMEOUT 0x01 // 廢棄 #define EV_READ 0x02 #define EV_WRITE 0x04 #define EV_SIGNAL 0x08 #define EV_PERSIST 0x10 // 持續觸發 #define EV_ET 0x20 // 邊沿模式 typedef void(*event_callback_fn)(evutil_sockt_t,short,void *); struct event *event_new( struct event_base *base, evutil_socket_t fd, // 文件描述符-int shord what, event_callback_fn cb, // 事件處理動做 void *arg );
void event_free(struct event *event);
設置未決事件(有資格可是沒有被處理的事件)後端
int event_add( struct event *ev, const struct timeval *tv );
int event_del(struct event *ev);
#define EVLOOP_ONCE 0x01 事件只會被觸發一次 事件沒有被觸發, 阻塞等 #define EVLOOP_NONBLOCK 0x02 非阻塞 等方式去作事件檢測 不關心事件是否被觸發了 #define EVLOOP_NO_EXIT_ON_EMPTY 0x04 沒有事件的時候, 也不退出輪詢檢測
event_base_dispatch(struct event_base* base)
struct timeval{ long tv_sec; long tv_usec; };
int event_base_loopexit( struct event_base *base, const struct timeval *tv );
int event_base_loopbreak(struct event_base *base);