TsgcWSPServer_DatasetEvents › OnMessage

OnMessage Event

Fires when a client sends a plain text message wrapped in the sgc envelope.

Syntax

property OnMessage: TsgcWSMessageEvent;
// TsgcWSMessageEvent = procedure(Connection: TsgcWSConnection; const Text: string) of object

Default Value

Remarks

Raised when a client calls WriteData, or receives a Broadcast whose method field is message. The sgc envelope is already stripped, so Text holds the payload as the client sent it. Dataset sync traffic does not flow through this event — record changes surface on the OnBefore/OnAfter record events.

Example

procedure TForm1.oProtocolMessage(Connection: TsgcWSConnection; const Text: string);
begin
  Memo1.Lines.Add(Connection.Guid + ': ' + Text);
end;

Back to Events