Usage of simple HTTP Server component in blocking mode

The Clever Internet Suite library provides a special TclSimpleHttpServer component that works in single-threaded blocking mode.

The usage of this component is really simple:

simpleServer := TclSimpleHttpServer.Create(nil);
 
port := simpleServer.Listen(80);
 
reqBody := simpleServer.AcceptRequest();
reqVersion := simpleServer.RequestVersion;
reqMethod := simpleServer.RequestMethod;
reqUrl := simpleServer.RequestUri;
reqContentType := simpleServer.RequestHeader.ContentType;
reqContentLength := simpleServer.RequestHeader.ContentLength;
 
simpleServer.ResponseVersion := hvHttp1_1;
simpleServer.ResponseHeader.ContentType := 'text/html';
simpleServer.KeepConnection := True;
 
simpleServer.SendResponse(200, 'OK', '<html><body>body content....</body></html>');
 
reqBody := simpleServer.AcceptRequest();
 
....etc.

Add Feedback