Skip to content

Commit 815ef0b

Browse files
committed
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.
1 parent 5dcaf94 commit 815ef0b

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

peer/channel.go

-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"io"
77
"net"
88
"sync"
9-
"time"
109

1110
"github.com/pion/datachannel"
1211
"github.com/pion/webrtc/v3"
@@ -245,13 +244,6 @@ func (c *Channel) Write(bytes []byte) (n int, err error) {
245244
if c.dc.BufferedAmount()+uint64(len(bytes)) >= maxBufferedAmount {
246245
<-c.sendMore
247246
}
248-
// REMARK: There's an obvious race-condition here. This is an edge-case, as
249-
// most-frequently data won't be pooled so synchronously, but is
250-
// definitely possible.
251-
//
252-
// See: https://github.com/pion/sctp/issues/181
253-
time.Sleep(time.Microsecond)
254-
255247
return c.rwc.Write(bytes)
256248
}
257249

0 commit comments

Comments
 (0)