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

Method SetWriteDeadline

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

Source from the content-addressed store, hash-verified

292}
293
294func (c *conn) SetWriteDeadline(t time.Time) error {
295 p := c.Writer.(*pipe)
296 p.mu.Lock()
297 defer p.mu.Unlock()
298 p.wtimer.Stop()
299 p.wtimedout = false
300 if !t.IsZero() {
301 p.wtimer = time.AfterFunc(time.Until(t), func() {
302 p.mu.Lock()
303 defer p.mu.Unlock()
304 p.wtimedout = true
305 p.wwait.Broadcast()
306 })
307 }
308 return nil
309}
310
311func (*conn) LocalAddr() net.Addr { return addr{} }
312func (*conn) RemoteAddr() net.Addr { return addr{} }

Callers 3

SetDeadlineMethod · 0.95
TestDeadlineMethod · 0.95

Calls 3

StopMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by 2

TestDeadlineMethod · 0.76