TsgcWSPServer_WAMPEvents › OnUnSubscription

OnUnSubscription Event

Fires when a client sends an UNSUBSCRIBE frame and the broker has removed it from the topic.

Syntax

property OnUnSubscription: TsgcWSSubscriptionEvent;
// TsgcWSSubscriptionEvent = procedure(Connection: TsgcWSConnection; const Subscription: String) of object

Default Value

Remarks

Raised after the internal subscriber list for Subscription has been updated to exclude Connection. The client will no longer receive EVENT messages for that topic URI. When a client disconnects without explicitly sending UNSUBSCRIBE, this event is not raised — the broker cleans the subscription up from OnDisconnect. Use this handler for audit logging or to release per-topic resources the application attached to the client.

Example


procedure TForm1.WAMPServerUnSubscription(Connection: TsgcWSConnection;
  const Subscription: String);
begin
  Memo1.Lines.Add(Format('[%s] left %s', [Connection.Guid, Subscription]));
end;

Back to Events