TsgcWSPClient_sgcEvents › OnEvent

OnEvent Event

Fires when a message is received on a subscribed channel.

Syntax

property OnEvent: TsgcWSCustomEvent;
// TsgcWSCustomEvent = procedure(Connection: TsgcWSConnection; const Channel, Text: string) of object

Default Value

Remarks

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.

Example

procedure TForm1.oProtocolEvent(Connection: TsgcWSConnection; const Channel, Text: string);
begin
  Memo1.Lines.Add(Format('[%s] %s', [Channel, Text]));
end;

Back to Events