mirror of
https://github.com/soypat/lneto.git
synced 2026-08-20 22:49:11 +00:00
Use backoff to wait until there is enough room in the TCP write buffer (#34)
This commit is contained in:
+1
-1
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user