Reputation: 564
it might seem like this question can be easily found in google, however all I can see are theoretical answers and not practical ones.
When an SDP offer or answer is created, my clients start releasing ICE Candidates, which I save into an array and send to the other client I want to connect with, and vise versa.
Now, both clients have access to their own ICE Candidates, and the ICE Candidates of the client they want to connect with. But how do I choose the best one, and if not so, how can I try all of them and see which one works?
Thank you.
Upvotes: 2
Views: 1367
Reputation: 343
You shouldn't keep ICE candidates in array, but send each candidate immediately. WebRTC has own logic to select the best pair of candidates depending on various factors, like network cost (for example, WiFi candidate is more preferable than LTE).
Upvotes: 3