[Lazarus] creating a Lazarus package "NoGUIApplication"

Michael Schnell mschnell at lumino.de
Wed Mar 17 12:00:58 CET 2010


On 03/16/2010 08:49 AM, Michael Van Canneyt wrote:
>
> CGI is standardized since ages, and is independent of the server
> software.
> I programmed my first CGI apps for NCSA httpd server 15 years ago, and
> things haven't changed since.
>
Absolutely true for "Standard" CGI. Here, with a HTTP request, the web
server starts a "command line tool" type of program ("filter") providing
information in the environment. The program creates a web page as its
standard output ("writeln"). The OS transfers this output to the web
server.  When the program terminates the web server transfers the web
page to the web client. Thus such a CGI program can't live longer than a
single HTTP request.

Apache (AFAIK) some time ago defined a way to do "persistent" CGI
programs. Here the information formerly placed in the environment is
transferred via a byte stream (pipe or TCP/IP) and the web page is
transferred in such a byte stream as well. AFAIK, other major web
servers support this method, too.

The Windows IIS uses a different paradigm called ISAPI, that is based on
the CGI program being a DLL (requiring a permanently running task in
same to be done as a thread).

Persistent CGIs offer less overhead (AFAIK, this was the main purpose to
define the paradigm) and more functionality: they support "states"
simply as global variables instead of needing to save any state change
in files or a database and permanently running tasks doing stuff
independently of the HTTP request, i.e. allowing for an - otherwise
normal - application with a "web" (browser) user interface.

-Michael




More information about the Lazarus mailing list