sharing a listen socket between processes

Phoenix Sol phoenix at burninglabs.com
Wed Apr 8 22:04:16 CEST 2009


Hi,

With libevent and it's 'evhttp' thing, a pool of worker threads or processes
can all listen on the same port, by calling evhttp_accept_socket(evhttp,
fd).

I like this so that I don't have to explicitly manage which worker answers
which connection, passing a fd every time. I also don't want to forward or
proxy, or do any copying that can be avoided.

Can I do this with the current libev?

What would be the best way to build a preforking server with libev?

Assume that upon every connection, a long-running connection handler is
launched in a lightweight, cooperative coroutine. I want a preforking server
so that these coroutines are efficiently spread across all available
processor cores.

Thanks  =)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20090408/e59aff67/attachment.html>


More information about the libev mailing list