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

Re: [Libevent-users] Shutting down the echo server



On Wed, Jun 20, 2012 at 5:32 AM, Ben Short <ben@xxxxxxxxxxxxxx> wrote:
> Hi,
>
> I've used the echo server example to implement my own server. I call
> the event_base_dispatch in a new thread.
>
> Is there anyway to do an orderly shutdown of the event dispatcher?
>
> I've tried event_base_loopbreak which returns 0 but the event_base_dispatch
> doesn't return.

If you're calling event_base_loopbreak from another thread and it
isn't shutting down the main event_base_dispatch loop, it sounds like
you probably didn't enable threading before creating the event base.

Have a look at the evthread_use_pthreads() and
evthread_use_windows_threads() functions and their documentation?

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