File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ import (
2626//
2727// Please be sure to call Close on the connection when you
2828// are finished with it to release the associated resources.
29+ //
30+ // Every error from Read or Reader will cause the connection
31+ // to be closed so you do not need to write your own error message.
32+ // This applies to the Read methods in the wsjson/wspb subpackages as well.
2933type Conn struct {
3034 subprotocol string
3135 br * bufio.Reader
@@ -311,6 +315,10 @@ func (c *Conn) handleControl(ctx context.Context, h header) error {
311315// The passed context will also bound the reader.
312316// Ensure you read to EOF otherwise the connection will hang.
313317//
318+ // All returned errors will cause the connection
319+ // to be closed so you do not need to write your own error message.
320+ // This applies to the Read methods in the wsjson/wspb subpackages as well.
321+ //
314322// You must read from the connection for close frames to be read.
315323// If you do not expect any data messages from the peer, just call
316324// Reader in a separate goroutine and close the connection with StatusPolicyViolation
You can’t perform that action at this time.
0 commit comments