You are not logged in.
Pages: 1
Hi Arnaud,
With TSQLRestFullMemory, can can configure the methods to run in the main thread,
but with THttpServer, it's not clear to me, is THttpServer.OnRequest() by default runs in the main thread? Because in that method I need to access the GUI.
thanks.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
No, THTTPServer runs in one of the thread of the thread pool.
Our TSQLRestServer classes handle tuned threading, not the low level THTTPServer.
Why are you using THTTPServer directly?
There is much more features in TSQLRestServer, and its overhead is very slight. Nothing noticeable in practice, when compare to the network bandwidth and the IP processing on server.
Following the single responsibility principle, we use THTTPServer to serve HTTP, not to do all the features possible.
Offline
Arnaud,
Update 1: Looks like example 22 - "JavaScript HTTPApi web server" can just server the static files perfectly, I should go from there! I check it out in depth.
---------------------------------------------------------------
I'm planning to use THTTPServer in LIVEditor, which is a live html and css editor I mentioned earlier.
It's going to be a standard HTTP server - when the files the web browser requests are not loaded into the code editor yet, it just like a standard http server, but if the files are loaded into the code editor, it will return the real-time html/css content from the code editor.
I hope I explained my requirement clearly here
Last edited by edwinsn (2014-09-08 16:05:40)
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Pages: 1