[fpc-pascal] fcl-web TFPHttpServer component problem

Graeme Geldenhuys graemeg.lists at gmail.com
Mon Nov 28 11:42:45 CET 2011


Hi,

I was testing the newish HTTP Server component located in
fcl-web/src/fphttpserver.pp

I simply created a form with Start/Stop button. The problem is, that
once I call .Active := True, it never returns from that call, so my
test program (and thus any program using this server component) is
stuck in limbo land...

Is this a known problem? And more importantly, is there a work-around?
I'm using FPC 2.5.1 (the latest revision in the 2.6.0 fixes branch).


procedure TMainForm.ButtonClicked(Sender: TObject);
begin
  if Button1.Text = 'Start' then
  begin
    writeln('before start');
    FHTTPServer.Active := True;
    writeln('after start');
    Button1.Text := 'Stop';
  end
  else
  begin
    writeln('before stop');
    FHTTPServer.Active := False;
    writeln('after stop');
    Button1.Text := 'Start';
  end;
end;


Note:
Once the HTTP Server is running, it does correctly handle and respond
to HTTP requests, so the worker thread of the http server is working.
It is just that the program implementing the HTTP Server component is
frozen, and its process has to be killed to terminate the http server.


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net



More information about the fpc-pascal mailing list