8
with indy TIdHTTPServer, OnCommandGet의 경우에도 AResponseInfo.ContentStream에 데이터가있는 스트림을 전달할 수 있습니다. 괜찮습니다. 언제 스트림을 출시 할 수 있습니까? 서버가 다중 요청을받을 수 있고 임의의 요청이 주어진 시간에 처리 될 수 있고 한 스트림이 다른 스트림에 임의로 완료 될 수 있다고 가정합니다.스트림을 CommandGet으로 전달한 후 언제 해제 할 수 있습니까?
스트림은 해제 될 수 있습니까?
코드 예제 :
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;
스트림가 해제 될 수 있는가? 심지어 IdHttpServer가 전송을 완료 한 것을 어떻게 알 수 있습니까?