Forum > Networking and Web Programming

fpweb/fcl-web: TCustomHTTPApplication and TThread.Queue/Synchronize

(1/1)

SirTwist:
Good Evening, dear fellows,

I am just trying my first steps with fpWeb and the standalone http server.
In addition to the standard framework I added a data module which I instantiated within the main application:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---begin  Application.Title:='webserver';  Application.CreateForm(TdmMain, dmMain);  Application.Port:=4040;  Application.LegacyRouting := False;  Application.Threaded:=True;  Application.Initialize;  Application.Run;end.
The web application itself is multithreaded, and so I want to synchronize some activities with the main thread. In "normal" (GUI) applications I call therefor TThread.Queue(@do_something) and everything works fine. In TCustomHTTPApplication, nothing will happen, and with a TThread.Synchronize the program will hang completly.

Has anyone a clue what is missing or what I am doing wrong here?

Kind regards,
Sir Twist

Warfley:
It seems that the FCL Web Applications don't check the message queue on the mainthread.
It also doesn't make sense, because the main thread should server the clients as fast as possible.

If you want to synchronize your threads, you need to do that yourself in a custom thread

Navigation

[0] Message Index

Go to full version