在libevent中,获取event类型对象的方法有两种,event_assign.event_new 1.event_assign() /** Prepare a new, already-allocated event structure to be added. The function event_assign() prepares the event structure ev to be used in future calls to event_add() and event_del…
分析libevent的源代码,我的想法的是先分析各种结构体,struct event_base.struct event,然后是event_base_new函数.event_new函数.event_add函数,最后分析event_base_dispatch函数. 一.各种结构体 1.event_base struct event_base { /** Function pointers and other data to describe this event_base's * backend.…