Use backoff to wait until there is enough room in the TCP write buffer (#34)

This commit is contained in:
ddirect
2026-02-09 02:27:18 +02:00
committed by GitHub
parent 085c7033cd
commit 1694e71e0c
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -218,7 +218,7 @@ func (conn *Conn) Write(b []byte) (int, error) {
conn.mu.Unlock()
n += ngot
b = b[ngot:]
if err != nil || n == plen {
if (err != nil && err != internal.ErrRingBufferFull) || n == plen {
break
} else if ngot > 0 {
backoff.Hit()