• Post Reply Bookmark Topic Watch Topic
  • New Topic

pls suggest a book.......  RSS feed

 
Friend
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can u pls suggest some books for cgi-c++ in Linux environment?
Thanks.
 
Tim Holloway
Saloon Keeper
Posts: 18797
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really think you're pursuing an extinct animal. I did a little searching on the 'net, and the O'Reilly book is no longer being printed. Another book on CGI and C was dated 1996 - eons ago in hi-tech years. You can get a short on-line course (in C) from http://www.papillion.ne.us/~sthomas/cgi_in_c.html
The primary reason for using C or C++ is speed - when it comes to features and maintainability, there are much better alternatives thes days, such as Java or PHP or Perl. The absolutely massive amount of overhead required to fork a new address space and process context is going to totally negate any speed boost in the app itself. On the Microsoft platform when C++ is called for, they write DLLs - which are NOT CGIs and which only work with IIS. On the Apache server, you'd write an Apache module - which isn't a CGI either. And so on for other servers.
Few web apps are timing-critical. It's not practical in an environment where users come in in statistical clumps. Nor does the cost of hardware justify it - My servers are junk P-200's replaceable for perhaps $200 each and the only time you'll see an objectionable delay is if you call on a JSP that has to be recompiled.
I wrote 2 or three CGI's in C or C++ (I forget) about 3 years ago. It was fun, but I wouldn't do it today except just to be able to day I'd done so.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While I agree with Tim's analysis, I also think it's important to recognize the original intent of the CGI protocol - to provide a common "gateway" to non-web-aware applications. I've encountered plenty of legacy applications which provide a powerful C/C++ API but no web UI and little support for any other language. If you want to web-enable such a system then some or all of the web interface will need to be written in C or C++. In most of these cases performance is not really an issue - but (say) being able to get web reports from that old accounts system or knowledgebase is vital to the business.
The trick is to not bother looking for C++/CGI resources, but to look for C++ resources and CGI resources separately. It's a trivial protocol, easily implemented, and the major effort should be spent in making sense of whetever system you are "gatewaying".
I have had a lot of success in the past in using a technique of writing a minimal CGI which returns data in a machine-readable format (TSV, XML, whatever) with no markup. This CGI interface is then used by a more capable web-application (in Java, say) which can cache returned data, handle concurrent client access and so on. Then, if the legacy application is retired, the Java "wrapper" application is just pointed at a different back-end.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!