6

I fired up a RTCDataChannel, and, by default it appears to be in unreliable mode.

I want to configure it to be reliable to get guaranteed packet delivery, but the RTCDataChannelInit configuration doesn't seem to have a setting for this.

dictionary RTCDataChannelInit {
             boolean        ordered = true;
             unsigned short maxPacketLifeTime;
             unsigned short maxRetransmits;
             DOMString      protocol = "";
             boolean        negotiated = false;
             unsigned short id;
}; 

Also, the RTCDataChannel.isReliable is a read-only property.

How do I configure the channel to be in reliable mode?

Andy Hin
  • 30,345
  • 42
  • 99
  • 142

1 Answers1

7

The default is a reliable channel. See the specification, fourth paragraph in that section.

Philipp Hancke
  • 15,855
  • 2
  • 23
  • 31
  • Thank you. @Philipp is right, the default is reliable. To expand on this answer a bit more, the actual parameter is set as part of the `RTCMediaConstraints` (and not `RTCDataChannelInit`). I had accidentally set the `RtpDataChannels` flag as an optional media constraint which caused the channel to be initialized as unreliable. – Andy Hin Feb 15 '16 at 15:36
  • 1
    RTP data channels are a legacy chrome thing (aka: don't work with Firefox), have been deprecated for almost two years and still lots of people stumble over this :-( – Philipp Hancke Feb 15 '16 at 15:59