dbotha
dbotha

Reputation: 1693

Should I wait for RTCPeerConnection.setRemoteDescription() & RTCPeerConnection.addIceCandidate() Promises to settle?

  1. RTCPeerConnection.setRemoteDescription() returns a Promise that resolves once the value of the connection's remoteDescription is successfully changed. Do I need to wait for this Promise to resolve successfully before calling RTCPeerConnection.addIceCandidate()?

  2. Furthermore RTCPeerConnection.addIceCandidate() returns a Promise which is fulfilled when the candidate has been successfully added to the remote peer's description by the ICE agent. Should I wait for this Promise to resolve successfully before adding the next available candidate via RTCPeerConnection.addIceCandidate() or can IceCandidates be added in parallel?

Upvotes: 0

Views: 407

Answers (1)

Philipp Hancke
Philipp Hancke

Reputation: 17265

That is not necessary, see the description of the operations chain in the specification which ensures in-order execution.

Upvotes: 2

Related Questions