Skip to content

Commit

Permalink
Update sctp and datachannel revs
Browse files Browse the repository at this point in the history
Resolves #334
  • Loading branch information
enobufs authored and backkem committed Feb 18, 2019
1 parent e35dc55 commit 0e9e1b0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
8 changes: 5 additions & 3 deletions datachannel.go
Expand Up @@ -151,20 +151,22 @@ func (d *DataChannel) open(sctpTransport *SCTPTransport) error {
var channelType datachannel.ChannelType
var reliabilityParameteer uint32

if d.MaxPacketLifeTime == nil && d.MaxRetransmits == nil {
switch {
case d.MaxPacketLifeTime == nil && d.MaxRetransmits == nil:
if d.Ordered {
channelType = datachannel.ChannelTypeReliable
} else {
channelType = datachannel.ChannelTypeReliableUnordered
}
} else if d.MaxRetransmits != nil {

case d.MaxRetransmits != nil:
reliabilityParameteer = uint32(*d.MaxRetransmits)
if d.Ordered {
channelType = datachannel.ChannelTypePartialReliableRexmit
} else {
channelType = datachannel.ChannelTypePartialReliableRexmitUnordered
}
} else {
default:
reliabilityParameteer = uint32(*d.MaxPacketLifeTime)
if d.Ordered {
channelType = datachannel.ChannelTypePartialReliableTimed
Expand Down
7 changes: 5 additions & 2 deletions datachannelparameters.go
Expand Up @@ -2,6 +2,9 @@ package webrtc

// DataChannelParameters describes the configuration of the DataChannel.
type DataChannelParameters struct {
Label string `json:"label"`
ID uint16 `json:"id"`
Label string `json:"label"`
ID uint16 `json:"id"`
Ordered bool `json:"ordered"`
MaxPacketLifeTime *uint16 `json:"maxPacketLifeTime"`
MaxRetransmits *uint16 `json:"maxRetransmits"`
}
3 changes: 2 additions & 1 deletion go.mod
Expand Up @@ -6,9 +6,10 @@ require (
github.com/pions/rtcp v1.0.0
github.com/pions/rtp v1.0.0
github.com/pions/sdp/v2 v2.0.0
github.com/pions/sctp v1.4.0
github.com/pions/srtp v1.0.3
github.com/pions/stun v0.2.0
github.com/pions/transport v0.1.1-0.20190213080349-17f3c4b39c85
github.com/pions/transport v0.2.0
github.com/pkg/errors v0.8.1
)

Expand Down
18 changes: 8 additions & 10 deletions go.sum
Expand Up @@ -4,8 +4,6 @@ github.com/cloudflare/sidh v0.0.0-20181111220428-fc8e6378752b h1:pqwbJdj1rgMkE38
github.com/cloudflare/sidh v0.0.0-20181111220428-fc8e6378752b/go.mod h1:o/DcCuWFr9jFzwO+c3y1hhwqKHHKfJ7HvLhWUwRnqfo=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk=
Expand All @@ -19,10 +17,8 @@ github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/pions/datachannel v1.2.1-0.20190213175340-e0de5f3cb51b h1:QyHuJ/CrY4SgCK1GvYOcwz5uZ43dJetmp1ETyvYp3Ps=
github.com/pions/datachannel v1.2.1-0.20190213175340-e0de5f3cb51b/go.mod h1:c7NviNwNFqg5fZQf4+Vq9IJppVLok8zAbsfDU1+w1Z4=
github.com/pions/dtls v1.1.1 h1:kGsFB9SzAwRS15Fog9cCefolO2M4oufqLcyxJ2JxR6k=
github.com/pions/dtls v1.1.1/go.mod h1:OgJcO0SqrDdQzqkCTdAp4xCQlbCmwZtGyhbthbq9zIA=
github.com/pions/datachannel v1.2.0 h1:N12qhHSRVlgBcaal2Hi4skdz7VI4yz6bNC5IJDMzCNw=
github.com/pions/datachannel v1.2.0/go.mod h1:MKPEKJRwX/a9/tyQvcVTUI9szyf8ZuUyZxSA9AVMSro=
github.com/pions/dtls v1.2.1 h1:QR7HLXROoi61iBUnHXDIJ1dtzFCiiXlHMe+lqgAH4W8=
github.com/pions/dtls v1.2.1/go.mod h1:OgJcO0SqrDdQzqkCTdAp4xCQlbCmwZtGyhbthbq9zIA=
github.com/pions/qtls-vendor-extracted v0.0.0-20190210024908-018998217c65 h1:skcEQZ2eUdm1WKlYu7y1y0HBzOwa1pgSAwvhG6PrI2s=
Expand All @@ -35,16 +31,18 @@ github.com/pions/rtp v1.0.0 h1:H/TUg7bhgBT/mQsUx0adW3cmgwqPmygoYbbRTc3Y7Ek=
github.com/pions/rtp v1.0.0/go.mod h1:GDIt4UYlSz7za4vfaLqihGJJ+yLvgPshnqrF/lm3vcM=
github.com/pions/sdp/v2 v2.0.0 h1:tWh8ehKPtXTaFYF12sBAHqYmhV36Q7YTmm3O6ycNa6M=
github.com/pions/sdp/v2 v2.0.0/go.mod h1:KGRBcHfpkgJXjrzKJz2wj/Jf1KWnsHdoIiqtayQ5QmE=
github.com/pions/sctp v1.3.2-0.20190213093554-e928d24e8af7 h1:SNkS2SC6UNpB7u+tNJ8TQ86i/TQvWa1ot8fnj1vvD8I=
github.com/pions/sctp v1.3.2-0.20190213093554-e928d24e8af7/go.mod h1:ijzi6pbK8+Oknxv5F1ZdN+tSYs5wm1ayaK2wtcYtyY0=
github.com/pions/sctp v1.3.0/go.mod h1:GZTG/xApE7wdUFEQq2Rmzgxl/+YaB/L1k8xUl1D5bmo=
github.com/pions/sctp v1.4.0 h1:U8SAVk+nWa2248SZGHCYsNyOqe/DM5+TKOAlh9Qdw8c=
github.com/pions/sctp v1.4.0/go.mod h1:dAna+Ct/aIIFiGW45yhGzuQjULWD7ni1vjoKHa9DsyU=
github.com/pions/srtp v1.0.3 h1:0rlg7yUHQblFA1e451mhx50IkA7+e48ja5K8mljyMYY=
github.com/pions/srtp v1.0.3/go.mod h1:egXe0STDyQDXLm7hjOMzuk7rkAhJ1SHOx+tTgtw/cQs=
github.com/pions/stun v0.2.0 h1:spIzpfkEg6HV+2iIo6qeOsAjtadZKzbXbrd2e9ZCCcs=
github.com/pions/stun v0.2.0/go.mod h1:rMdCIsqqnTLC4MOHJE3LNiFQRfIjUDzI1kzx//7oPOM=
github.com/pions/transport v0.0.0-20190110151433-e7cbf7d5f464/go.mod h1:HLhzI7I0k8TyiQ99hfRZNRf84lG76eaFnZHnVy/wFnM=
github.com/pions/transport v0.1.0 h1:9IEn3i8pmK8rMyQIqhT2RozgXJNH4k+IuNDzV5y+ddw=
github.com/pions/transport v0.1.0/go.mod h1:HLhzI7I0k8TyiQ99hfRZNRf84lG76eaFnZHnVy/wFnM=
github.com/pions/transport v0.1.1-0.20190213080349-17f3c4b39c85 h1:15sCQuKIkCabeLAx8jpt361lWikiqNNrAArnMyV5Ofw=
github.com/pions/transport v0.1.1-0.20190213080349-17f3c4b39c85/go.mod h1:HLhzI7I0k8TyiQ99hfRZNRf84lG76eaFnZHnVy/wFnM=
github.com/pions/transport v0.2.0 h1:e3B5V7rATCNCxl0qlU0S0ofpt1E77X5pCbeUVQ0ntpA=
github.com/pions/transport v0.2.0/go.mod h1:HLhzI7I0k8TyiQ99hfRZNRf84lG76eaFnZHnVy/wFnM=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down

0 comments on commit 0e9e1b0

Please sign in to comment.