TsgcWSPServer_FilesEvents › OnRawMessage

OnRawMessage Event

Fired before the subprotocol parses a text message, allowing custom handling.

Syntax

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

Default Value

Remarks

Called with the raw text payload before the Files subprotocol decodes its envelope. Set Handled to True to consume the message and skip the default processing; leave it False to let the subprotocol handle it as usual.

Example

procedure TForm1.oFilesRawMessage(Connection: TsgcWSConnection; const Text: string; var Handled: Boolean);
begin
  if Pos('ping', Text) = 1 then
    Handled := True;
end;

Back to Events