From 60aa40a56f586fac90ee4c9c326f1584a1447ead Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Tue, 3 May 2022 09:00:59 -0500 Subject: [PATCH] fix: Remove microsecond wait in peer.(*Channel) (#1270) 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 a1c63abcfc..5a4424f8bf 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) }