Re: Data channel issues

On 06/12/2012 10:26 AM, Adam Bergkvist wrote:
> On 2012-06-11 15:12, SUN Yang wrote:
>> Hi
>>
>> I support early data, it is very benefitial for some information
>> exchange, for example: user status, device capability etc.
>
> People, at the interim meeting, seemed to prefer to wait for the open 
> event. One reason to align with the rest of the web platform (e.g. 
> WebSocket). I also think that the "early" part i mainly in the API 
> call flow - you're allowed to call send on a newly created DataChannel 
> object without waiting for the connected event. The channel still 
> needs to be setup properly before the data actually is sent.
I think this:

function OpenAndSendData = function(data) {
    conn = pc.CreateDataConnection();
    conn.onconnect = function() {
         conn.send(data);
    }
}

will accomplish exactly the same thing as browser-buffered "early" data, 
at the expense of a short trip through the JS layer on the "onconnect" 
event.

Received on Tuesday, 12 June 2012 08:57:55 UTC