[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] How to break out libevent's dispatch loop



On Tue, Mar 24, 2015 at 5:35 AM, Mark Ruys <mark.ruys@xxxxxxxxxxxxxx> wrote:
> Posted also at
> http://stackoverflow.com/questions/29219314/how-to-break-out-libevents-dispatch-loop
>
 [...]
> The behavior is that if you run the program, request a page, abort the
> program by Ctrl-C, the event_base_dispatch() keeps running *until* you fetch
> another web page. Only then the loop aborts and the program terminates. What
> I need is that the dispatch loop is exited immediately, not after the next
> page request. Is this possible?

If you need the event loop to exit before running any more callbacks,
use event_base_break()

http://www.wangafu.net/~nickm/libevent-book/Ref3_eventloop.html

hope this helps,
-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.