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

Re: [Libevent-users] Problems with outbound HTTP posts



On Tue, Oct 30, 2012 at 3:53 PM, Ringel, Rick <Rick.Ringel@xxxxxxxx> wrote:
> You don't need the while loop around event_base_dispatch - it is your
loop.

I've used Boost for a few things, and in that library, I found the service
thread does return occasionally.  It was defensive code, sort of my seat
belt.

event_base_dispatch returns only if there are no events to wait for. It this case you will have a busy loop.

If you want to prevent this return, you can add a timeout event with very long timeout, and make it persistent.