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

Method finishRead

read.go:244–258  ·  view source on GitHub ↗

finishRead clears the read timeout and reports whether the connection or operation context ended while the read was in progress.

(ctx context.Context, err *error, timeoutSet bool)

Source from the content-addressed store, hash-verified

242// finishRead clears the read timeout and reports whether the connection or
243// operation context ended while the read was in progress.
244func (c *Conn) finishRead(ctx context.Context, err *error, timeoutSet bool) {
245 if timeoutSet {
246 c.clearReadTimeout()
247 }
248 select {
249 case <-c.closed:
250 if *err != nil {
251 *err = net.ErrClosed
252 }
253 default:
254 }
255 if *err != nil && ctx.Err() != nil {
256 *err = ctx.Err()
257 }
258}
259
260func (c *Conn) readFrameHeader(ctx context.Context) (_ header, err error) {
261 timeoutSet, err := c.prepareRead(ctx)

Callers 2

readFrameHeaderMethod · 0.95
readFramePayloadMethod · 0.95

Calls 1

clearReadTimeoutMethod · 0.95

Tested by

no test coverage detected