How to use the Simple HTTP Server component in the blocking mode

The Clever Internet Suite library provides a special TclSimpleHttpServer component, which works in the 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