On Tue, Sep 3, 2013 at 3:09 AM, Yucong Sun <[email protected]> wrote: > Hi, > > I have a event loop with a mix of network socket based event and timer > events. in one of the network event handler, I want to create another event > that run immediately after current set of active network based events. > > I'm currently using a timer event (EV_TIMEOUT) and call event_active() right > away, hoping it will be attached to tail of current active event. But it > doesn't seem to be working as I thought. > > Am I doing something wrong? > > Thanks.
Events ordinarily run in the same order in which they first become active. If you want a newly active event to have its callback run before events that were already active, it needs to have a higher (numerically lower) priority. Have a look at the event priority functions for more information. peace, -- Nick *********************************************************************** To unsubscribe, send an e-mail to [email protected] with unsubscribe libevent-users in the body.
