TsgcWSPClient_FilesEvents › OnRawMessage

OnRawMessage Event

Fires with the untouched incoming text before the subprotocol parses it; set Handled to stop default processing.

Syntax

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

Default Value

Remarks

Useful to intercept or log messages before they reach the protocol parser, or to implement custom framing on top of the same transport. When Handled is True the subprotocol skips its own dispatch and OnMessage/OnFile* are not raised.

Example

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

Back to Events