Skip to content

Commit 66cf07b

Browse files
committed
Clarify Reader semantics
1 parent 058e736 commit 66cf07b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

websocket.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,10 @@ func (c *Conn) handleControl(ctx context.Context, h header) error {
333333
// This applies to the Read methods in the wsjson/wspb subpackages as well.
334334
//
335335
// You must read from the connection for control frames to be handled.
336+
// Thus if you expect messages to take a long time to be responded to,
337+
// you should handle such messages async to reading from the connection
338+
// to ensure control frames are promptly handled.
339+
//
336340
// If you do not expect any data messages from the peer, call CloseRead.
337341
//
338342
// Only one Reader may be open at a time.

0 commit comments

Comments
 (0)