with indy TIdHTTPServer, on an even OnCommandGet, it is possible to transmit an AResponseInfo.ContentStream data stream. what well. when can i free this thread? assuming that the server can receive several requests, and any request can be processed at a given time, and one thread can execute arbitrary for another.
where can the thread be freed?
Code example
:
var StreamsToFree : TList; //assume StreamsToFree := TList.create; properly procedure TObject.IdHttpServerCommandGet(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo); var stream : TFileStream; begin stream := TFileSTream.create('file.name'); AResponseInfo.ContentStream := stream; AResponseInfo.ResponseNo := 200; StreamsToFree.Add(generateReceiptXML); end;
When can a thread be freed? what even, and how do we know IdHttpServer, completed its transfer?
memory-management stream delphi delphi-2009 indy
none
source share