Re-organize CreateDataChannel function and add limited spec compliance

This commit is contained in:
Konstantin Itskov
2018-09-04 12:11:17 -04:00
parent 3ac52b89d8
commit 0a2568695a
11 changed files with 286 additions and 89 deletions

View File

@@ -5,8 +5,7 @@ package webrtc
type RTCDataChannelInit struct {
// Ordered indicates if data is allowed to be delivered out of order. The
// default value of true, guarantees that data will be delivered in order.
// TODO make sure defaults to true
Ordered bool
Ordered *bool
// MaxPacketLifeTime limits the time (in milliseconds) during which the
// channel will transmit or retransmit data if not acknowledged. This value
@@ -19,7 +18,7 @@ type RTCDataChannelInit struct {
MaxRetransmits *uint16
// Protocol describes the subprotocol name used for this channel.
Protocol string
Protocol *string
// Negotiated describes if the data channel is created by the local peer or
// the remote peer. The default value of false tells the user agent to
@@ -27,11 +26,11 @@ type RTCDataChannelInit struct {
// corresponding RTCDataChannel. If set to true, it is up to the application
// to negotiate the channel and create an RTCDataChannel with the same id
// at the other peer.
Negotiated bool
Negotiated *bool
// ID overrides the default selection of ID for this channel.
ID uint16
ID *uint16
// Priority describes the priority of this channel.
Priority RTCPriorityType
Priority *RTCPriorityType
}