ICE Client
Run the full ICE algorithm in Delphi/C++Builder — gather host, server-reflexive and relay candidates, perform STUN connectivity checks, nominate the best pair per RFC 8445.
Run the full ICE algorithm in Delphi/C++Builder — gather host, server-reflexive and relay candidates, perform STUN connectivity checks, nominate the best pair per RFC 8445.
Implements the RFC 8445 ICE state machine — candidate gathering, prioritisation, pair generation, connectivity checks (BindingRequest with USE-CANDIDATE), nomination and consent freshness.
TsgcICEClient
Windows, macOS, Linux, iOS, Android
Professional / Enterprise
Configure STUN/TURN ICE servers, call GatherCandidates, exchange the candidate list with the peer (out of band), then StartChecks to nominate a working pair.
uses
sgcP2P;
var
ICE: TsgcICEClient;
begin
ICE := TsgcICEClient.Create(nil);
ICE.IceServers.Add('stun:stun.l.google.com:19302');
ICE.IceServers.Add('turn:turn.example.com', 'alice', 'secret');
ICE.OnICELocalCandidate := procedure(Sender: TObject;
const aCandidate: string)
begin
SignalToPeer(aCandidate); // out-of-band SDP / WebSocket
end;
ICE.OnICEConnectionStateChanged := procedure(Sender: TObject;
const aState: TsgcICEConnectionState)
begin
Memo1.Lines.Add('ICE: ' + GetEnumName(TypeInfo(TsgcICEConnectionState), Ord(aState)));
end;
ICE.GatherCandidates;
end;
// uses: sgcP2P
TsgcICEClient *ICE = new TsgcICEClient(this);
ICE->IceServers->Add("stun:stun.l.google.com:19302");
ICE->GatherCandidates();
A reusable ICE engine that drops below TsgcRTCPeerConnection — or runs on its own for non-WebRTC P2P.
Enumerates host candidates from every local interface, server-reflexive candidates from each STUN server, relayed candidates from each TURN server — all in parallel.
Computes the candidate-pair priorities per RFC 8445 §6.1.2 and orders the check list. Frozen pairs unfreeze as their foundation makes progress.
Sends STUN BindingRequests with PRIORITY, ICE-CONTROLLING / ICE-CONTROLLED, USE-CANDIDATE attributes per the standard. Triggered checks fire on inbound stimulus.
When a pair succeeds and the controlling agent flags USE-CANDIDATE, the component fires OnICEConnectionStateChanged with iceConnected, then iceCompleted on the final selected pair.
Implements RFC 7675 consent-freshness probes — periodic STUN BindingRequests on the nominated pair, with OnICEConnectionStateChanged(iceFailed) when consent is lost.
The component does not assume a specific signalling channel — you marshal local candidates over your WebSocket / SIP / HTTP signalling, and feed remote candidates back in.
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.
| Online Help — TsgcICEClient Full property, method and event reference for this component. | Open | |
| Demo Project — Demos\35.P2P\04.ICE Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |