[fpc-pascal] visualserver from VisualSynapse how implement it as a Linux console Daemon

TOUZEAU DAVID david.touzeau at fr.kaspersky.com
Fri Oct 6 18:02:25 CEST 2006


Dear

is anybody there use visualserver from VisualSynapse  
(http://visualsynapse.sourceforge.net/?id=8) and impleted it on Linux 
has a console mode...??
Examples given is only on application interface ...

Problems:

1) When the application start, no web page are generated...
2) i would like to develop a variant of this web server. In this case, i 
need to trap the requests received by the process.

Here it is a sample that didn't working

//*************************************************************************************************
program shttpserver;

{$mode objfpc}{$H+}

uses
//ArticaAgent
  cthreads,custapp, Classes, SysUtils, fpcunit,httpserver ;

const
  Version = 'Version 0.1';

type
  TTestRunner = class(TCustomApplication)
  private

 
  protected
    procedure DoRun; override;
  public
  procedure Listen(receive:string);
  end;

procedure TTestRunner.DoRun;
  var
    I: integer;
    S: string;
  begin
   //  writeln('create...');
   end;
  
procedure TTestRunner.Listen(receive:string);
  begin
   //  writeln('string received: ' + receive);
   end;

var
  App: TTestRunner;
  eHTTP : TvsHTTPServer;
begin
  App := TTestRunner.Create(nil);
  eHTTP := TvsHTTPServer.Create(nil);
  eHTTP.LogFile := 'httplog.log';
  eHTTP.ServerName := 'Visual Synapse Demo HTTP Server';
  eHTTP.ListenPort := '8000';
  eHTTP.SSL := False;
  eHTTP.ListenIP := '0.0.0.0'; //any
  eHTTP.RegisterDir ('/home/touzeau/Desktop/visualserverdemo/web', '/');
  eHTTP.RegisterDefaultDoc('index.htm');
  eHTTP.Active := True;
 // eHTTP.OnGet := @App.Listen; //not working it seems that here i can 
receive requests from clients.

  App.Initialize;
  App.Title := 'Console  www.';
  App.Run;
  App.Free;
end.

//*************************************************************************************************

-- 

David Touzeau -------------------------- Linux Ubuntu Dapper 6.0.6 
FreePascal-Lazarus,perl,delphi,php icq:160018849



More information about the fpc-pascal mailing list