I'm using Delphi 2006 and Indy 10. I create a form and drop down an IdHttpServer component. I make an OnCreate event for the form to set the server active, and I enter these lines for the server's OnCommandGet:
procedure TForm3.IdHTTPServerCommandGet(AContext: TIdContext;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
begin
Beep;
Sleep(10000);
AResponseInfo.ContentText := DateTimeToStr(Now);
end;
Note the Sleep for 10 seconds.
I then test with Firefox, using 2 browsers. I have the first one connect to "localhost", and I hear a beep right away. I then tab to the 2nd browser, and have it connect to localhost (in less than 10 seconds), but it doesn't beep right away. It waits for the 1st request to complete, then beeps, and waits another 10 seconds.
I thought these components were multi-threaded? Is there some property I can set to make it behave the way I thought it would (both requests would get answered immediately).