I am working on DataSnap project in Delphi XE2 using TCP/IP protocol that needs to pass a stream of binary data to the server as a method parameter. The problem I am running into is that there seems to be a size limit of about 32 KB on the stream contents. Beyond this limit the stream received at the server is empty. If I pass additional method parameters they arrive intact so it seems to be an issue at the parameter level.
Here is how the DataSnap service class is declared:
TDataSnapTestClient = class(TDSAdminClient)
private
FSendDataCommand: TDBXCommand;
public
constructor Create(ADBXConnection: TDBXConnection); overload;
constructor Create(ADBXConnection: TDBXConnection; AInstanceOwner: Boolean); overload;
destructor Destroy; override;
procedure SendData(Data: TStream);
end;
The approach I am using should work, at least according to the article by Jim Tierney. That said, there apparently have been changes since Delphi 2009 that have broken Jim Tierney's sample code.
DataSnap Server Method Stream Parameters
Any ideas on how to resolve this issue would be greatly appreciated.
TStream
. I used Ethereal to watch the transferred packets, and it transfers the binary data in 32k chunks until all chunks are received. - James L.