Skip to content

Commit 22638e0

Browse files
committed
Document separate idle and read timeout
Closes #87
1 parent e883cde commit 22638e0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

websocket.go

+5
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,11 @@ func (c *Conn) handleControl(h header) {
342342
// be read if you do not read the message from the connection.
343343
//
344344
// Only one Reader may be open at a time.
345+
//
346+
// If you need a separate timeout on the Reader call and then the message
347+
// Read, use time.AfterFunc to cancel the context passed in early.
348+
// See https://github.com/nhooyr/websocket/issues/87#issue-451703332
349+
// Most users should not need this.
345350
func (c *Conn) Reader(ctx context.Context) (MessageType, io.Reader, error) {
346351
typ, r, err := c.reader(ctx)
347352
if err != nil {

0 commit comments

Comments
 (0)