Hi Danijel,
I use RtcMessageClient+RtcDataRequest to upload file to server (RtcMessageServer+RtcDataProvider).
I Use RtcDataRequest.OnDataSent like this:
procedure TApiUploader.DataSent(Sender: TRtcConnection);
var
bSize:int64;
begin
with TRtcDataClient(Sender) do
begin
if Request.ContentLength>Request.ContentOut then
begin
bSize:=Request.ContentLength-Request.ContentOut;
if bSize>64000 then bSize:=64000;
Write(Read_File(Request.Info.asText['file'], Request.ContentOut, bSize));
end;
end;
end;
And I got exception: "Error! Answer allready sent for this request." because
Request.ContentOut is always 0 it's not updated every Write call so I send more data than expected. But this code works well with RtcHttpClient - with Http CountentOut updates as expected !
It's another limitation of RtcMessageClient ? Or probably bug in RTC ?
p.s. For file downloading I use similar code on server side: Response.ContentOut is used for file reading. So, it's works with RtcMessageServer ! If Response.ContentOut works on server side I expect Request.ContentOut should works on client side ! Or I missing something ?