TsgcWSPServer_WebRTCEvents › OnRawMessage

OnRawMessage Event

Fires before signalling decoding, letting the server inspect every incoming text frame and optionally suppress further processing.

Syntax

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

Default Value

Remarks

Called before the JSON envelope is parsed into a signalling message, so Text is the verbatim frame — for example {"method":"sgc@webrtc","webrtc":{"type":"offer","sdp":"…"}}. Set Handled := True to consume the frame completely: the component will skip its own decoder and none of the dedicated events (OnBeforeSubscription, OnSubscription…) will fire for that message, and the SDP/ICE relay will not run. Leave Handled := False to use the event purely for logging or capture while letting the signalling layer proceed normally.

Example


procedure TForm1.WebRTCServerRawMessage(Connection: TsgcWSConnection;
  const Text: string; var Handled: Boolean);
begin
  Memo1.Lines.Add(Format('[%s] raw: %s', [Connection.Guid, Text]));
  Handled := False;
end;

Back to Events