[Lazarus] creating a Lazarus package "NoGUIApplication"

Michael Van Canneyt michael at freepascal.org
Wed Mar 17 13:28:45 CET 2010



On Wed, 17 Mar 2010, Michael Schnell wrote:

> 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.

This is fastcgi, which is supported by FPC, see my other mail.

>
> 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).

Apache has the same, it's an apache module. You can create one in FPC.

>
> 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.

Yes, and as I said, the fastcgi implementation of FPC supports this.

Or you could create an apache module.

Michael.




More information about the Lazarus mailing list