TsgcWSPServer_WAMP › Events › OnMessage

OnMessage Event

Fires for incoming text frames from a client that the WAMP decoder did not route to a dedicated RPC or PubSub event.

Syntax

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

Default Value

—

Remarks

Standard WAMP v1 frames (PREFIX, CALL, CALLCANCEL, SUBSCRIBE, UNSUBSCRIBE, PUBLISH) are consumed by the protocol decoder and raised through their dedicated events (OnCall, OnBeforeSubscription, OnPrefix…). Any other text frame — typically an application-specific extension or a message with an unknown type id — surfaces here. Silently ignoring the frame is safe; WAMP v1 has no contract obliging the server to acknowledge unrecognised messages.

Example


procedure TForm1.WAMPServerMessage(Connection: TsgcWSConnection;
  const Text: string);
begin
  Memo1.Lines.Add(Format('[%s] passthrough: %s', [Connection.Guid, Text]));
end;

Back to Events