TsgcWSPClient_PresenceEvents › OnRawMessage

OnRawMessage Event

Fires for every incoming frame before Presence parsing; set Handled to skip default handling.

Syntax

property OnRawMessage: TsgcWSRawMessageEvent;
// TsgcWSRawMessageEvent = procedure(Connection: TsgcWSConnection; const Text: string; var Handled: Boolean) of object

Default Value

Remarks

Fires with the raw Text received from the transport before the Presence layer decodes it. This is the right place to log, inspect or forward the JSON envelope. Set Handled to True to stop the Presence client from dispatching the default OnNewMember / OnPublishMsg / OnSession events for this frame.

Example

procedure TForm1.oPresenceRawMessage(Connection: TsgcWSConnection;
  const Text: string; var Handled: Boolean);
begin
  Memo1.Lines.Add('Raw: ' + Text);
end;

Back to Events