TsgcWSPClient_WAMPEvents › OnMessage

OnMessage Event

Fires for incoming text frames that the WAMP decoder did not route to a higher-level RPC or PubSub handler.

Syntax

property OnMessage: TsgcWSMessageEvent;
// TsgcWSMessageEvent = procedure(Connection: TsgcWSConnection; const Text: string) of object

Default Value

Remarks

Standard WAMP v1 frames (WELCOME, CALL, CALLRESULT, CALLERROR, EVENT, etc.) are consumed by the protocol decoder and raised through their dedicated events (OnWelcome, OnCallResult, OnCallError, OnEvent…). Any remaining text frame — typically server-specific extensions or messages with an unknown type id — surfaces here so the application can still inspect it. Returning without processing the text is safe; WAMP has no acknowledgement contract for unrecognised messages.

Example


procedure TForm1.WAMPMessage(Connection: TsgcWSConnection;
  const Text: string);
begin
  Memo1.Lines.Add('passthrough: ' + Text);
end;

Back to Events