W3C home > Mailing lists > Public > public-webrtc@w3.org > June 2012

Re: Validity period of createOffer() offers.

From: Martin Thomson <martin.thomson@gmail.com>
Date: Fri, 1 Jun 2012 14:59:49 -0700
Message-ID: <CABkgnnVYfSqnXaxo+KVt3Sy3A2i9om9goo=MHj+3Hifzk4vbZw@mail.gmail.com>
To: snandaku <snandaku@cisco.com>
Cc: Eric Rescorla <ekr@rtfm.com>, public-webrtc@w3.org
On 1 June 2012 14:03, snandaku <snandaku@cisco.com> wrote:
>>>> On the similar lines I am not sure what should be the user agent behavior
> for JavaScript mistakes like this
>   for(I -> 1 till 100)
>   pc.createOffer(function(offer) {
>     //do nothing
>  });
>  pc.createOffer(function(offer)) {
>    //set local description
>   });
>
Actually, that's the easy one.  Each of the 101 calls to createOffer
either get in line for the resource or subsequent calls fail.

Recall the asynchronous nature of javascript that means that after the
following code is run, there is 101 tasks that are oustanding.
Presumably the first has a mutex and the other 100 are blocked on that
mutex.  When the first call fails, the next runs, ad nauseum, until
the last one actually does something with the offer.
Received on Friday, 1 June 2012 22:00:20 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:28 UTC