TsgcWSPServer_Dataset › Events › OnUnSubscription
Fires after a client unsubscribes from a channel.
property OnUnSubscription: TsgcWSSubscriptionEvent;
// TsgcWSSubscriptionEvent = procedure(Connection: TsgcWSConnection; const Subscription: String) of object
—
Fires once per channel after a successful UnSubscribe, including the fan-out caused by UnSubscribeAll and by automatic cleanup at disconnect. Subscription holds the bare channel name (without the Guid prefix). By the time the event fires the connection has already been removed from the subscriber list, so further publications on that channel will not reach it.
procedure TForm1.oProtocolUnSubscription(Connection: TsgcWSConnection;
const Subscription: String);
begin
Memo1.Lines.Add(Connection.Guid + ' left ' + Subscription);
end;