TsgcWSPServer_sgcEvents › OnSubscription

OnSubscription Event

Fires after a client successfully subscribes to a channel.

Syntax

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

Default Value

Remarks

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.

Example

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

Back to Events