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

Method SetReadDeadline

test/bufconn/bufconn.go:277–292  ·  view source on GitHub ↗
(t time.Time)

Source from the content-addressed store, hash-verified

275}
276
277func (c *conn) SetReadDeadline(t time.Time) error {
278 p := c.Reader.(*pipe)
279 p.mu.Lock()
280 defer p.mu.Unlock()
281 p.rtimer.Stop()
282 p.rtimedout = false
283 if !t.IsZero() {
284 p.rtimer = time.AfterFunc(time.Until(t), func() {
285 p.mu.Lock()
286 defer p.mu.Unlock()
287 p.rtimedout = true
288 p.rwait.Broadcast()
289 })
290 }
291 return nil
292}
293
294func (c *conn) SetWriteDeadline(t time.Time) error {
295 p := c.Writer.(*pipe)

Callers 2

SetDeadlineMethod · 0.95
TestDeadlineMethod · 0.95

Calls 3

StopMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by 1

TestDeadlineMethod · 0.76