Re: Suggestion for changes to IceGatherer to make it possible to signal IceParameters without gathering

On Fri, Nov 27, 2015 at 3:43 PM, Peter Thatcher wrote:



> With the current API, is it viable to construct an IceGatherer but delay

> attaching the onlocalcandidate event handler until IceCandidates are desired

> ​?

>



​Yes, that's possible, however:



1.  It's clunky.



2.  It has the side effect that just to generate some text (an offer), you

have to start gathering candidates, which means STUN and TURN network

traffic.  Now, I suppose we could tell the gatherer "gather with policy ==

none right now" and then later say "ok, gather with policy == all".  But

that's even more clunky.



[BA] In addition to being clunky, “gather upon construction” has

proven difficult to implement.  For example, in C/C++ or C#, if you don’t

attach an event handler, the events vanish.  So workarounds are required

(like creating a bogus event handler and queuing the events until the JS

event handler is attached).





> The premise of Issue 224 is that the gatherPolicy passed in the

> IceGatherer constructor determines whether the IceGatherer gathers upon

> construction or not (if "none" is passed).  Therefore a start() method

> would need a gatherPolicy argument so as to allow setting a policy

> different from "none".  If we go with Peter's proposal, we would not need a

> "none" gatherPolicy, and could forgo the argument to start(), correct?

>



​[pthatcher] I think you're right.  We either have a none policy or a start method.  I

prefer the latter.  It's less clunky.​



[BA] Can you review the following PR (which adds the gather() method):

https://github.com/openpeer/ortc/pull/432

Received on Wednesday, 16 March 2016 21:24:40 UTC