TsgcWSPServer_WebRTCEvents › OnUnSubscription

OnUnSubscription Event

Fires when a peer leaves a signalling channel and the server has removed it from the subscriber list.

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 in response to an explicit sgc@unsubscribe frame. The peer will no longer receive SDP offers, answers or ICE candidates forwarded for that channel. When a peer disconnects without sending UNSUBSCRIBE first the server cleans the room up in OnDisconnect (honouring WebRTC.CloseSessionOnHangup) and this event is not raised. Use the handler for audit logging or to release per-room resources attached to the peer.

Example


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

Back to Events