TsgcWSPServer_sgc › Events › OnSubscription
Fires after a client successfully subscribes to a channel.
property OnSubscription: TsgcWSSubscriptionEvent;
// TsgcWSSubscriptionEvent = procedure(Connection: TsgcWSConnection; const Subscription: String) of object
—
Fires once per channel after OnBeforeSubscription accepts the request and the connection has been registered in the subscription list. Subscription holds the bare channel name (without the Guid prefix). Use this hook to update presence, prime the client with a snapshot, or emit audit logs.
procedure TForm1.oProtocolSubscription(Connection: TsgcWSConnection;
const Subscription: String);
begin
Memo1.Lines.Add(Connection.Guid + ' subscribed to ' + Subscription);
end;