TsgcWSPServer_PresenceEvents › OnRawMessage

OnRawMessage Event

Fired for every raw frame received before the Presence protocol parses it.

Syntax

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

Default Value

Remarks

Gives you the unparsed text of every WebSocket text frame arriving on a Presence connection. Set Handled to True to stop the framework from parsing the frame as a Presence message (useful when you want to intercept and route non-Presence payloads yourself).

Example

procedure TForm1.sgcWSPServer_Presence1RawMessage(Connection: TsgcWSConnection;
  const Text: string; var Handled: Boolean);
begin
  Log('<< ' + Text);
  // Handled := True; // to skip default Presence parsing
end;

Back to Events