MCPcopy
hub / github.com/wavetermdev/waveterm / SetRwndSize

Method SetRwndSize

pkg/jobmanager/streammanager.go:251–268  ·  view source on GitHub ↗

SetRwndSize dynamically updates the receive window size

(rwndSize int)

Source from the content-addressed store, hash-verified

249
250// SetRwndSize dynamically updates the receive window size
251func (sm *StreamManager) SetRwndSize(rwndSize int) error {
252 sm.lock.Lock()
253 defer sm.lock.Unlock()
254 if rwndSize < 0 {
255 return fmt.Errorf("rwndSize cannot be negative")
256 }
257 if !sm.connected {
258 return fmt.Errorf("not connected")
259 }
260 sm.rwndSize = rwndSize
261 effectiveWindow := sm.cwndSize
262 if sm.rwndSize < effectiveWindow {
263 effectiveWindow = sm.rwndSize
264 }
265 sm.buf.SetEffectiveWindow(true, effectiveWindow)
266 sm.drainCond.Signal()
267 return nil
268}
269
270// Close shuts down the sender loop. The reader loop will exit on its next iteration
271// or when the underlying reader is closed.

Callers 1

StartStreamMethod · 0.80

Calls 1

SetEffectiveWindowMethod · 0.80

Tested by

no test coverage detected