From 3b20a49a2c6fc9aa28be7d5296afe2079ff0e537 Mon Sep 17 00:00:00 2001 From: Anmol Sethi <hi@nhooyr.io> Date: Sat, 9 Jan 2021 08:01:54 -0500 Subject: [PATCH] Add back documentation on separate idle and read timeout Closes #87 --- read.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/read.go b/read.go index afd08cc..87151dc 100644 --- a/read.go +++ b/read.go @@ -26,6 +26,11 @@ import ( // Call CloseRead if you do not expect any data messages from the peer. // // Only one Reader may be open at a time. +// +// If you need a separate timeout on the Reader call and the Read itself, +// use time.AfterFunc to cancel the context passed in. +// See https://github.com/nhooyr/websocket/issues/87#issue-451703332 +// Most users should not need this. func (c *Conn) Reader(ctx context.Context) (MessageType, io.Reader, error) { return c.reader(ctx) } -- GitLab