MCPcopy
hub / github.com/grpc/grpc-go / onData

Method onData

internal/transport/flowcontrol.go:174–185  ·  view source on GitHub ↗

onData is invoked when some data frame is received. It updates pendingData.

(n uint32)

Source from the content-addressed store, hash-verified

172
173// onData is invoked when some data frame is received. It updates pendingData.
174func (f *inFlow) onData(n uint32) error {
175 f.mu.Lock()
176 defer f.mu.Unlock()
177
178 f.pendingData += n
179 if f.pendingData+f.pendingUpdate > f.limit+f.delta {
180 limit := f.limit
181 rcvd := f.pendingData + f.pendingUpdate
182 return fmt.Errorf("received %d-bytes data exceeding the limit %d bytes", rcvd, limit)
183 }
184 return nil
185}
186
187// onRead is invoked when the application reads the data. It returns the window size
188// to be sent to the peer.

Callers 2

handleDataMethod · 0.45
handleDataMethod · 0.45

Calls 3

ErrorfMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected