TsgcWSPClient_WAMPEvents › OnEvent

OnEvent Event

Fires when a published event arrives on a topic this client has previously subscribed to.

Syntax

property OnEvent: TsgcWSEvent;
// TsgcWSEvent = procedure(Connection: TsgcWSConnection; TopicURI, Event: string) of object

Default Value

Remarks

Delivered in response to a WAMP EVENT frame (type id 8), triggered when any session (including this one, unless the publisher used the excludeMe extension) calls Publish on a matching topic. TopicURI is the fully-resolved URI — prefixes are always expanded by the server before dispatch. Event carries the JSON payload exactly as supplied to Publish. Event delivery is at-most-once: if the transport drops before the frame is processed the event is lost.

Example


procedure TForm1.WAMPEvent(Connection: TsgcWSConnection;
  TopicURI, Event: string);
begin
  Memo1.Lines.Add(Format('[%s] %s', [TopicURI, Event]));
end;

Back to Events