TsgcWSPClient_Dataset › Events › OnEvent
Fires when a message is received on a subscribed channel.
property OnEvent: TsgcWSCustomEvent;
// TsgcWSCustomEvent = procedure(Connection: TsgcWSConnection; const Channel, Text: string) of object
—
Delivers Publish notifications from other clients (or from the server) for channels the client has subscribed to. Channel holds the channel name and Text the payload exactly as it was published. Dataset synchronization messages are not routed through this event: they are dispatched to the specialized OnBeforeNewRecord / OnBeforeUpdateRecord / OnBeforeDeleteRecord and their After counterparts instead.
procedure TForm1.oProtocolEvent(Connection: TsgcWSConnection; const Channel, Text: string);
begin
Memo1.Lines.Add(Format('[%s] %s', [Channel, Text]));
end;