Re: [rtcweb] DataChannels API and external negotiation

This looks fine, but I'd like to bike shed just a little.

On 31 March 2013 19:29, Randell Jesup <randell-ietf@jesup.org> wrote:
> Here's a proposed API for DataChannels with external negotiation, per the
> recent Interim and IETF meeting (most of this was in my previous W3 email,
> but I've added info on when 'stream' is valid to read, and how even/odd
> roles are assigned for the IETF protocol). I'll note for the IETF folks that
> 'protocol' is in a JS dictionary object in this update, which avoids
> breaking any current experimental applications (and avoids them having any
> incentive to UA-sniff).  Also, I think it works better in the dictionary.
>
>   channel = peerconnection.createDataChannel(label, dictionary_object);
>
> /* If either maxRetransmitTime or maxRetransmitNum are set, it's
>    unreliable, else it's a reliable channel.  If both are set it's an
>    error.  outOfOrderAllowed can be used with any type of channel.  The
>    equivalent of UDP is { outOfOrderAllowed: true, maxRetransmitNum: 0 }.
>    The TCP equivalent is {}.
>
>    preset is set to true if the channel is being externally negotiated, and
>    no wireline OpenRequest message should be sent.  If preset is true,
> stream
>    can be optionally used to set a specific SCTP stream to use.  If it's
>    not set but preset is true, then the application should read the 'stream'
>    attribute from the returned DataChannel after onopen and convey it to the
>    other end to pass in via the DataChannelInit dictionary.
>  */

A lot of your text can be replaced by defaults on the dictionary.

I prefer 'ordered' over 'outOfOrderAllowed', even if it means an
inversion of the values.  'rtxCount' or 'retransmitCount' rather than
'maxRetransmitNum'  (max is implied).

'preset' doesn't sound right, maybe you could have 'inlineOpen'
(default: true) to convey what is really happening here.

> dictionary DataChannelInit {
>   boolean ordered = true;
>   unsigned short retransmitPeriod = 65535; // !
>   unsigned short retransmitCount = 65535;
>   DOMString protocol;    // default: undefined
>   boolean inlineOpen = true;
>   unsigned short stream;    // default: browser selected
> };

unsigned short is an unusual type for time intervals, even if you
don't foresee a need for more than 65 seconds.  Oh, and that assumes
that you are using milliseconds, right?

Received on Monday, 1 April 2013 16:49:09 UTC