TsgcICEClientEvents › OnICECandidatePairNominated

OnICECandidatePairNominated Event

Fires when a candidate pair passes connectivity checks and is nominated as the selected path for the session.

Syntax

property OnICECandidatePairNominated: TsgcICECandidatePairNominatedEvent;
// TsgcICECandidatePairNominatedEvent = procedure(Sender: TObject; const aCandidatePair: TsgcICE_CandidatePair) of object

Default Value

Remarks

Fires when a candidate pair has completed bidirectional STUN binding checks (the controlling agent has sent a binding request with the USE-CANDIDATE attribute and received the matching success response per RFC 8445 section 7). aCandidatePair.Local and aCandidatePair.Remote hold the pair that won the election along with its priority and type (host/srflx/prflx/relay). From this point the pair is the valid path for application data; SRTP/DTLS or plain UDP traffic can be sent over it. If more than one pair is nominated for trickle ICE the last notification represents the currently selected pair.

Example

procedure TForm1.oICEICECandidatePairNominated(Sender: TObject;
  const aCandidatePair: TsgcICE_CandidatePair);
begin
  DoLog(Format('Nominated: %s:%d <-> %s:%d',
    [aCandidatePair.Local.IP, aCandidatePair.Local.Port,
     aCandidatePair.Remote.IP, aCandidatePair.Remote.Port]));
end;

Back to Events