TsgcRTCPeerConnectionEvents › OnRTCCandidatePairFailed

OnRTCCandidatePairFailed Event

Fired when an ICE candidate pair fails the connectivity check; the reason is provided.

Syntax

property OnRTCCandidatePairFailed: TsgcRTCCandidatePairFailedEvent;
// TsgcRTCCandidatePairFailedEvent = procedure(Sender: TObject; const aCandidatePair: TsgcICE_CandidatePair; const aReason: string) of object

Default Value

Remarks

Raised when a candidate pair cannot be validated by ICE. aCandidatePair contains the local/remote endpoints that failed and aReason is a short textual description of the failure (timeout, STUN error, DTLS error, etc.). ICE keeps trying other pairs, so a failed pair does not necessarily mean the session will not connect; use this event for diagnostics or to decide whether to restart gathering after too many failures.

Example

procedure TForm1.oRTCCandidatePairFailed(Sender: TObject;
  const aCandidatePair: TsgcICE_CandidatePair; const aReason: string);
begin
  Log(Format('pair failed %s:%d -> %s:%d (%s)',
    [aCandidatePair.Local.Address, aCandidatePair.Local.Port,
     aCandidatePair.Remote.Address, aCandidatePair.Remote.Port, aReason]));
end;

Back to Events