From 815ef0baf3f1e5d5a8373842a235450acaed69fe Mon Sep 17 00:00:00 2001 From: kylecarbs Date: Tue, 3 May 2022 13:54:58 +0000 Subject: [PATCH] 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. --- peer/channel.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/peer/channel.go b/peer/channel.go index a1c63abcfc3db..5a4424f8bf91c 100644 --- a/peer/channel.go +++ b/peer/channel.go @@ -6,7 +6,6 @@ import ( "io" "net" "sync" - "time" "github.com/pion/datachannel" "github.com/pion/webrtc/v3" @@ -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) }