user482594
user482594

Reputation: 17486

In WebRTC, can ICE candidates be re-used across different RTCPeerConnections?

I am working on setting up group calls involving up to 8 peers using WebRTC.

Let's say a peer needs to set up 7 RTCPeerConnections to join a group call. Instead of relying on onicecandidate event for every single RTCPeerConnection, I was wondering if I can track the client's icecandidates in a central location and reuse it for each new RTCPeerConnection. (e.g. Signaling Server will keep track of a peer's full ICE candidates, and share them with other peers as soon as they need them).

I am unsure what the average number of 'icecandidates' each client will have, but with ice trickle process, it seems that many duplicate http or websocket calls will need to be made to a Signaling Server in oder to exchange ice candidates between any 2 peers.

So I was wondering if I could just "accumulate" ice candidates locally and reuse them when new RTCPeerConnection will need to be made with new peer.

Upvotes: 2

Views: 1141

Answers (1)

Philipp Hancke
Philipp Hancke

Reputation: 17360

You can not. ICE candidates are associated with the peerconnection and its ice username fragment and password. There is a feature called ice forking that would allow what you ask for but it is not implemented yet. https://bugs.chromium.org/p/webrtc/issues/detail?id=11252#c3 has some details.

Upvotes: 6

Related Questions