MCPcopy Index your code
hub / github.com/coder/websocket / setupReadTimeout

Method setupReadTimeout

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

Source from the content-addressed store, hash-verified

186}
187
188func (c *Conn) setupReadTimeout(ctx context.Context) bool {
189 if ctx.Done() == nil {
190 return false
191 }
192
193 stop := context.AfterFunc(ctx, func() {
194 c.clearReadTimeout()
195 c.close()
196 })
197 swapTimeoutStop(&c.readTimeoutStop, &stop)
198 return true
199}
200
201func (c *Conn) clearReadTimeout() {
202 swapTimeoutStop(&c.readTimeoutStop, nil)

Callers 1

prepareReadMethod · 0.95

Calls 3

clearReadTimeoutMethod · 0.95
closeMethod · 0.95
swapTimeoutStopFunction · 0.85

Tested by

no test coverage detected