event_add
2016-09-23 17:11:33 1 举报
AI智能生成
libevent
作者其他创作
大纲/内容
event_add
if(tv != NULL && !(ev->ev_flags & EVLIST_TIMEOUT))
if (ev->ev_events & (EV_READ|EV_WRITE))
初始化或获取struct evmap_io *ctx
设置old(events)
设置res(events)
设置struct event_change ch
ch.fd = fd;
ch.old_events = old;
ch.read_change = ch.write_change = 0;
根据events设置ch.write_change/read_change
events = EPOLLIN | EPOLLOUT | EPOLLET
op = EPOLL_CTL_ADD | EPOLL_CTL_MOD
epev.data.fd = ch->fd;
epev.events = events;
if (ev->ev_events & EV_SIGNAL)
0 条评论
回复 删除
下一页