TsgcICEClientEvents › OnICECandidatePairFailed

OnICECandidatePairFailed Event

Fires when a candidate pair fails connectivity checks; the pair is dropped and the next one in the check list is tried.

Syntax

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

Default Value

Remarks

Fires when the STUN binding check for aCandidatePair does not succeed: no response, timeout after the full retransmission schedule, ICMP error, STUN error response (401/403/487) or role conflict. aReason contains a human-readable description (for example Timeout, Role Conflict, Unauthorized). The pair state moves to Failed and the agent proceeds with the remaining pairs; if no pair succeeds before ICEOptions.CheckList.MaxCandidatePairs is exhausted the overall ICE session ends in failure.

Example

procedure TForm1.oICEICECandidatePairFailed(Sender: TObject;
  const aCandidatePair: TsgcICE_CandidatePair; const aReason: string);
begin
  DoLog(Format('Pair failed: %s:%d <-> %s:%d reason=%s',
    [aCandidatePair.Local.IP, aCandidatePair.Local.Port,
     aCandidatePair.Remote.IP, aCandidatePair.Remote.Port, aReason]));
end;

Back to Events