MCPcopy
hub / github.com/coder/websocket / setupWriteTimeout

Method setupWriteTimeout

conn.go:171–182  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

169}
170
171func (c *Conn) setupWriteTimeout(ctx context.Context) bool {
172 if ctx.Done() == nil {
173 return false
174 }
175
176 stop := context.AfterFunc(ctx, func() {
177 c.clearWriteTimeout()
178 c.close()
179 })
180 swapTimeoutStop(&c.writeTimeoutStop, &stop)
181 return true
182}
183
184func (c *Conn) clearWriteTimeout() {
185 swapTimeoutStop(&c.writeTimeoutStop, nil)

Callers 1

writeFrameMethod · 0.95

Calls 3

clearWriteTimeoutMethod · 0.95
closeMethod · 0.95
swapTimeoutStopFunction · 0.85

Tested by

no test coverage detected