IdHTTPServer CommandGet multithreaded

Giganews Newsgroups
Subject: IdHTTPServer CommandGet multithreaded
Posted by:  Tomas (tom…@gmail.com)
Date: Wed, 12 Mar 2008

Hi,

Could anybody explain how to make event HTTPServerCommandGet multithreaded?
I use code below to receive and response to user request, everything works
fine except that code below is not multithreaded,
idHTTPServer do not take more incoming request until first request is
finished.

procedure TfrmMain.HTTPServerCommandGet(AContext: TIdContext; ARequestInfo:
  TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
begin

  Job(ARequestInfo.PostStream); //Can take up to 10 seconds
  AResponseInfo.ContentStream := AResponseStream;

end;

Regards,
Tomas

Replies