TsgcWSPServer_sgcEvents › OnUnSubscription

OnUnSubscription Event

Fires after a client unsubscribes from a channel.

Syntax

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

Default Value

Remarks

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.

Example

procedure TForm1.oProtocolUnSubscription(Connection: TsgcWSConnection;
  const Subscription: String);
begin
  Memo1.Lines.Add(Connection.Guid + ' left ' + Subscription);
end;

Back to Events