TsgcRTCPeerConnection › Events › OnRTCCandidatePairNominated
Fired when ICE connectivity checks nominate a candidate pair; set Accept to False to reject.
property OnRTCCandidatePairNominated: TsgcRTCCandidatePairNominatedEvent;
// TsgcRTCCandidatePairNominatedEvent = procedure(Sender: TObject; const aCandidatePair: TsgcICE_CandidatePair; var Accept: Boolean) of object
—
Raised when the ICE agent has completed its connectivity checks and selected a working path between the peers. aCandidatePair exposes the local and remote candidate (type, address, port, priority and control role). When Accept is True, the component continues the handshake (DTLS, data channel) using that pair; set Accept to False to discard the pair and wait for another nomination, which is useful to enforce policies such as "only accept non-relay paths".
procedure TForm1.oRTCCandidatePairNominated(Sender: TObject;
const aCandidatePair: TsgcICE_CandidatePair; var Accept: Boolean);
begin
Log(Format('nominated %s:%d -> %s:%d',
[aCandidatePair.Local.Address, aCandidatePair.Local.Port,
aCandidatePair.Remote.Address, aCandidatePair.Remote.Port]));
Accept := True;
end;