TsgcICEClient › Methods › AddRTCIceCandidate
Registers a remote ICE candidate received from the peer so it can be paired with the local candidate set.
procedure AddRTCIceCandidate(const aCandidate: string);
| Name | Type | Description |
|---|---|---|
aCandidate | const string | SDP candidate attribute (RFC 8839 / RFC 5245) received from the remote peer, for example candidate:1 1 UDP 2122252543 192.0.2.1 54321 typ host. |
Call this method for every remote candidate received through the signalling channel (for example the onicecandidate message emitted by a browser WebRTC peer). The string is parsed into a TsgcICE_Candidate record and added to the remote candidate list. The ICE agent then builds candidate pairs (local x remote) ordered by priority, ready for connectivity checks.
Call ProcessCandidates once both sides have exchanged their candidates to start the STUN binding checks. Trickle ICE is supported: candidates may be added at any time and new pairs are scheduled as they arrive.
// remote candidate received via your signalling channel (WebSocket, SSE, ...)
oICE.AddRTCIceCandidate('candidate:1 1 UDP 2122252543 192.0.2.1 54321 typ host');
oICE.AddRTCIceCandidate('candidate:2 1 UDP 1686052607 198.51.100.7 40000 typ srflx raddr 10.0.0.5 rport 54321');
oICE.ProcessCandidates;