FastCGI C library with async I/O?
Jens Alfke <jens-mAcipnqRhZf2eFz/[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
I'm looking at serving HTTP from an existing C++ application, by using FastCGI to receive requests from Apache. Unfortunately the standard FastCGI SDK doesn't fit my requirements because it uses blocking I/O, meaning that it can either process only a single request at a time, or must spawn a new thread for every simultaneous request. Neither of these options work for me -- parallel requests are a must, I can't spawn new instances of the app, and multiple threads are problematic, primarily because the app code isn't thread-safe. Ideally I'd like a comparable library that uses async I/O so I can keep running everything on a single thread. (This is what the app already uses for its existing networking.) The API would have to be a bit different, most likely invoking callbacks into my code when events happen, or even letting me manage the actual I/O and feeding the received bytes into the library. Does such a thing exist? On the website I didn't see any C/C++ options other than the standard SDK. I am leery of writing my own because the FastCGI protocol is fairly complex, and bugs in the implementation are likely to lead to security holes. If I can't find a library that exists, I'm likely to switch to SCGI instead simply because the protocol is so simple. Or alternatively, if anyone knows of a C/C++ library that implements a small HTTP server embedded in an app, I could use that with Apache's mod_proxy. Thanks for any tips... --Jens ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/