I am again in a situation where I spent foul time trying to configure datasnap callback patterns for my needs. I am an old OOP programmer for schoolchildren and I have some very large hierakies objects in my PODO tool style :-) .. and having this great datasnap function, I want to use callback forces.
BUT - when I implement it ... it just fails ... (FASTMM4 reports memory leaks).
Try creating a simple VCL datasnap server - TCP. And add a button and this source ...
procedure TForm1.Button1Click(Sender: TObject);
var
aJSONVal : TJSONValue;
begin
aJSONVal := TJSONObject.Create;
ServerContainer1.DSServer1.BroadcastMessage('SomeChannel','SomeCallbackID',aJSONVal);
end;
It will work - as long as you continue to use TJSONValue ... But try switching the commented code - and you will see what I mean.
I could, of course, change all existing code to JSON ... but this is simply unacceptable.
- , BroadcastOBJECT NotifyOBJECT?