tags:

views:

399

answers:

4
+3  Q: 

FastCGI for C++

I've found only two FastCGI libraries for C++. There's the "official" one, and fastcgi++. How is either one better than the other? Do any others exist?

+1  A: 

As fastcgi++ is still listed as "Development Status: 4- Beta" so I would suggest going for the offical one. It has been around for ages and has bindings for a whole host of languages. Licences between the 2 don't seem to make much difference. Put some measurements in your code and if performance is an issue then spend some time playing around with alternatives.

roguenut
A: 

The C-version of FastCGI does very little, and developping in C++ isn't such a big problem as it nearly doesn't interfer with your own code. It's most likely just a loop and an environment variable.

So my advice would be just to stick with the official version.

Just be aware of one thing: it works by redifing printf! So if you use cout it won't work.

Tristram Gräbener
A: 

See also the Cgicc library:

http://www.gnu.org/software/cgicc/

The library appears to be mature (currently at version 3.x). According to the documentation it can be used with FastCGI by passing a custom reader (reader_function_t) to the constructor of the Cgicc class.

Yukiko
A: 

What you probably want is hidden in the contrib directory of Cgicc package.

fcgi-test.cpp is an example of how to use cgicc with FastCGI.

Path to the installed fcgi-test.cpp should be /usr/share/doc/libcgicc-doc/examples/contrib/fcgi-test.cpp

Korusef