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 (
3333// The Addr methods will return a mock net.Addr that returns "websocket" for Network
3434// and "websocket/unknown-addr" for String.
3535//
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.
3738func NetConn (c * Conn , msgType MessageType ) net.Conn {
3839 nc := & netConn {
3940 c : c ,
@@ -93,7 +94,7 @@ func (c *netConn) Read(p []byte) (int, error) {
9394 typ , r , err := c .c .Reader (c .readContext )
9495 if err != nil {
9596 var ce CloseError
96- if xerrors .As (err , & ce ) && (ce .Code == StatusNormalClosure ) {
97+ if xerrors .As (err , & ce ) && (ce .Code == StatusNormalClosure ) || ( ce . Code == StatusGoingAway ) {
9798 c .eofed = true
9899 return 0 , io .EOF
99100 }
You can’t perform that action at this time.
0 commit comments