Re: addIceCandidate() mandatory success callback

On 03/10/2014 05:27 PM, Adam Bergkvist wrote:
> Hi
>
> What's the intended use for the mandatory success callback for 
> addIceCandidate()?
>
> For methods like setRemoteDescription(), the success callback is used 
> as a continuation for the application flow; the remote description was 
> successfully set and I can go ahead and, for example, create an 
> answer. I don't see the same use for the addIceCandidate() success 
> callback. In fact, if you would have to wait for that callback before 
> doing anything else in your app, it would complicate things a lot. 
> It's pretty convenient to be able to treat the candidate exchange as 
> something that runs in parallel with your other offer/answer exchanges.
>
> /Adam
>
It's a guarantee that the error callback will never be called subsequent 
to the success callback. If your error callback just throws an exception 
and aborts the app, you don't need it; if the error callback actually 
tries to do something smarter, it can get messy fast if you don't have this.

I've worked on systems where you had to program to an expectation that 
an error could happen at any time subsequent to invoking a function (but 
would only happen once) - it was not pretty, and I won't do that if I 
can avoid it.

Received on Thursday, 13 March 2014 09:53:06 UTC