MCPcopy
hub / github.com/cloudflare/cloudflared / SetDeadline

Method SetDeadline

websocket/connection.go:71–79  ·  view source on GitHub ↗

SetDeadline sets both read and write deadlines, as per net.Conn interface docs: "It is equivalent to calling both SetReadDeadline and SetWriteDeadline." Note there is no synchronization here, but the gorilla implementation isn't thread safe anyway

(t time.Time)

Source from the content-addressed store, hash-verified

69// "It is equivalent to calling both SetReadDeadline and SetWriteDeadline."
70// Note there is no synchronization here, but the gorilla implementation isn't thread safe anyway
71func (c *GorillaConn) SetDeadline(t time.Time) error {
72 if err := c.Conn.SetReadDeadline(t); err != nil {
73 return fmt.Errorf("error setting read deadline: %w", err)
74 }
75 if err := c.Conn.SetWriteDeadline(t); err != nil {
76 return fmt.Errorf("error setting write deadline: %w", err)
77 }
78 return nil
79}
80
81type Conn struct {
82 rw io.ReadWriter

Callers 1

DialEdgeFunction · 0.45

Calls 3

SetReadDeadlineMethod · 0.80
ErrorfMethod · 0.80
SetWriteDeadlineMethod · 0.80

Tested by

no test coverage detected