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

Method Reader

read.go:35–37  ·  view source on GitHub ↗

Reader reads from the connection until there is a WebSocket data message to be read. It will handle ping, pong and close frames as appropriate. It returns the type of the message and an io.Reader to read it. The passed context will also bound the reader. Ensure you read to EOF otherwise the connect

(ctx context.Context)

Source from the content-addressed store, hash-verified

33// See https://github.com/nhooyr/websocket/issues/87#issue-451703332
34// Most users should not need this.
35func (c *Conn) Reader(ctx context.Context) (MessageType, io.Reader, error) {
36 return c.reader(ctx)
37}
38
39// Read is a convenience method around Reader to read a single message
40// from the connection.

Callers 10

ReadMethod · 0.95
CloseReadMethod · 0.95
TestConnFunction · 0.45
BenchmarkConnFunction · 0.45
ExampleCloseStatusFunction · 0.45
wstestCaseCountFunction · 0.45
readMethod · 0.45
readFunction · 0.45
EchoLoopFunction · 0.45
echoFunction · 0.45

Calls 1

readerMethod · 0.95

Tested by 4

TestConnFunction · 0.36
BenchmarkConnFunction · 0.36
ExampleCloseStatusFunction · 0.36
wstestCaseCountFunction · 0.36