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

: DataConnection objects

From: Sunyang (Eric) <eric.sun@huawei.com>
Date: Tue, 12 Jun 2012 09:22:18 +0000
To: Randell Jesup <randell-ietf@jesup.org>, "public-webrtc@w3.org" <public-webrtc@w3.org>
Message-ID: <9254B5E6361B1648AFC00BA447E6E8C32AEA54E3@szxeml545-mbx.china.huawei.com>
Why we limit one DataConnection per one PeerConnection?
This DataConnection is only used by non-media data right, so why we have maxStreams?
Does you mean data streams but not mediastreams?

-----ʼԭ-----
: Randell Jesup [mailto:randell-ietf@jesup.org] 
ʱ: 2012612 16:26
ռ: public-webrtc@w3.org
: DataConnection objects

Building on the discussions today in the WebRTC W3 WG meeting:

In PeerConnection, replace

DataChannel createDataChannel (
      [TreatNullAs=EmptyString] DOMString? label,
      optional DataChannelInit? dataChannelDict);

With

DataConnection createDataConnection(short initialStreams);

Add:

interface DataConnection {
     DataChannel createDataChannel (
              [TreatNullAs=EmptyString] DOMString? label,
              optional DataChannelInit? dataChannelDict);
     attribute short maxStreams;
     const unsigned short CONNECTING = 0;
     const unsigned short OPEN = 1;
     const unsigned short CLOSING = 2;
     const unsigned short CLOSED = 3;
     readonly attribute unsigned short readyState;
     [TreatNonCallableAsNull]
              attribute Function?      onopen;
     [TreatNonCallableAsNull]
              attribute Function?      onerror;
     [TreatNonCallableAsNull]
              attribute Function?      onclose;
     void close ();
};

readyState may need to be changed to strings

Calling createDataConnection() before CreateOffer will cause the offer 
to include a DataConnection.  Calling it after the PeerConnection is 
connected will cause a renegotiation.

There can only be one DataConnection per PeerConnection at any time; 
attempting to create a second one will fail.

maxStreams lets you renegotiate the maximum number of simultaneous open 
streams.

Plus appropriate language about what happens if you close/destroy the 
DataConnection (close/disconnect all DataChannels, etc)

Open question: How does this interact with CreateAnswer?  They can call 
createDataConnection and then CreateAnswer, but they need to know that 
the offer asked for a DataConnection.  (Justin, Cullen)?

Open question: createDataChannel before onopen: does it queue?  Given 
we've exposed this object, I'd guess no, and trying to create one when 
not in the open readyState will fail.

Open question: Do we need a global DataConnection priority, or just 
priorities on the individual DataChannels?

-- 
Randell Jesup
randell-ietf@jesup.org

Received on Tuesday, 12 June 2012 09:32:20 UTC

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