• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

pls suggest a book.......

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can u pls suggest some books for cgi-c++ in Linux environment?
Thanks.
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic