Good day,
I have the following setup in my application:
Main thread uses the http libevent server to service basic keep-alive
http requests.
If the main thread processes the even call back, the system runs fine.
The keep-alive remains alive and the information travels backwards and
forwards over the same socket.
I have recently added some code to do the following:
- Setup a worker pool of threads that sit waiting on a condition
variable.
- The main thread takes the request struct and puts it in to the queue
of a thread, wakes the thread up and asks the thread to deal with it.
- Main thread returns to even processing.
- Thread answers the request and then goes back to sleep.
The problem I have is that it'll process one request and then stop.
I think the problem is that when I call evhttp_send_reply, having
followed through the various code paths, the setup for listening on
the socket for more data isn't registered, therefore even though more
information arrives - it isn't seen. I think this could be because the
event loop is running rather than in a paused "event delivery mode" or
something of that nature.
I am thinking that potentially registering a listen on the socket as
soon as the event call back, in the http server, is called could
potentially solve this problem but I wondered if anyone had any words
of wisdom.
Thank you for your time,
Chris Ross
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users