Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: Remove microsecond wait in peer.(*Channel)
This was implemented when our WebRTC code was much less hardened.
It's likely this was a cause of some other problem.

Closes #1076.
  • Loading branch information
kylecarbs committed May 3, 2022
commit 815ef0baf3f1e5d5a8373842a235450acaed69fe
8 changes: 0 additions & 8 deletions peer/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"io"
"net"
"sync"
"time"

"github.com/pion/datachannel"
"github.com/pion/webrtc/v3"
Expand Down Expand Up @@ -245,13 +244,6 @@ func (c *Channel) Write(bytes []byte) (n int, err error) {
if c.dc.BufferedAmount()+uint64(len(bytes)) >= maxBufferedAmount {
<-c.sendMore
}
// REMARK: There's an obvious race-condition here. This is an edge-case, as
// most-frequently data won't be pooled so synchronously, but is
// definitely possible.
//
// See: https://github.com/pion/sctp/issues/181
time.Sleep(time.Microsecond)

return c.rwc.Write(bytes)
}

Expand Down