File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ import (
33
33
// The Addr methods will return a mock net.Addr that returns "websocket" for Network
34
34
// and "websocket/unknown-addr" for String.
35
35
//
36
- // A received StatusNormalClosure close frame will be translated to EOF when reading.
36
+ // A received StatusNormalClosure or StatusGoingAway close frame will be translated to
37
+ // io.EOF when reading.
37
38
func NetConn (c * Conn , msgType MessageType ) net.Conn {
38
39
nc := & netConn {
39
40
c : c ,
@@ -93,7 +94,7 @@ func (c *netConn) Read(p []byte) (int, error) {
93
94
typ , r , err := c .c .Reader (c .readContext )
94
95
if err != nil {
95
96
var ce CloseError
96
- if xerrors .As (err , & ce ) && (ce .Code == StatusNormalClosure ) {
97
+ if xerrors .As (err , & ce ) && (ce .Code == StatusNormalClosure ) || ( ce . Code == StatusGoingAway ) {
97
98
c .eofed = true
98
99
return 0 , io .EOF
99
100
}
You can’t perform that action at this time.
0 commit comments