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

Re: [Libevent-users] libevent is blocking on me



Niels,

Thank you for your prompt response. I have a call of event_dispatch in my main function

but I also need a event_dispatch in my http_get_query function which is called to fetch data from

a remote host when my http handler is called.

When someone visits my web site which runs evhttp, I need to query another remote server for data.

Everything works except that my http_get_query function starts grinding to a halt after 50 or so request.

Is their a specific way that I need to execute this in for it to be able to handle atleast 1K/req sec without blocking when each req needs to fetch data from a remote host.

I tried looking for examples of evhttp servers that implement something similar but no luck.

Thank you for your help, I appreciate it.

Ron

On Thu, Jan 21, 2010 at 2:25 AM, Niels Provos <provos@xxxxxxxxx> wrote:
On Wed, Jan 20, 2010 at 1:19 PM, Ron Combs <roncombs64@xxxxxxxxx> wrote:
> I am not performing the request in a event base. I am running
> evhttp_make_request followed by event_dispatch right in the http handler,
> can this be a problem?

There should only be a single call to event_dispatch() in your code.
Probably in the main function.

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