On Wed, Nov 21, 2007 at 06:06:51PM +0100, Nicolas Favre-Félix <[EMAIL
PROTECTED]> wrote:
> I am trying to implement a server using a "pre-fork" design. It
> currently works great with a custom protocol, but I'd like to integrate
> HTTP support - using evhttp.
libevent doesn't support forking (unless you force it to use select or
poll) and continue using it in the child.
you might have more luck with the libev replacement library for libevent,
which supports forking (but you need to explicitly call a function for
this to work, and,. depending on how your server works, you need to
unregister the existing event handlers or create a new event loop in your
child process).
> How can I have all the forked children handle the queries?
There is no clean way known to do this with libevent, because you cnanot
destroy and recreate the event loop nor does it survive a fork.
You might have luck with ignoring the parent event loop and create a new
one in your child, at the expense of losing resources.
--
The choice of a Deliantra, the free code+content MORPG
-----==- _GNU_ http://www.deliantra.net
----==-- _ generation
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / [EMAIL PROTECTED]
-=====/_/_//_/\_,_/ /_/\_\
_______________________________________________
Libevent-users mailing list
[email protected]
http://monkeymail.org/mailman/listinfo/libevent-users