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 (
26
26
//
27
27
// Please be sure to call Close on the connection when you
28
28
// 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.
29
33
type Conn struct {
30
34
subprotocol string
31
35
br * bufio.Reader
@@ -311,6 +315,10 @@ func (c *Conn) handleControl(ctx context.Context, h header) error {
311
315
// The passed context will also bound the reader.
312
316
// Ensure you read to EOF otherwise the connection will hang.
313
317
//
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
+ //
314
322
// You must read from the connection for close frames to be read.
315
323
// If you do not expect any data messages from the peer, just call
316
324
// Reader in a separate goroutine and close the connection with StatusPolicyViolation
You can’t perform that action at this time.
0 commit comments