mirror of https://github.com/gorilla/websocket.git
recover from timeout error
This commit is contained in:
parent
a91eba7f97
commit
0d7be512eb
8
conn.go
8
conn.go
|
@ -958,7 +958,13 @@ func (c *Conn) NextReader() (messageType int, r io.Reader, err error) {
|
||||||
panic("repeated read on failed websocket connection")
|
panic("repeated read on failed websocket connection")
|
||||||
}
|
}
|
||||||
|
|
||||||
return noFrame, nil, c.readErr
|
err = c.readErr
|
||||||
|
if netErr, ok := err.(net.Error); ok && netErr.Timeout() {
|
||||||
|
c.readErr = nil
|
||||||
|
c.readErrCount--
|
||||||
|
}
|
||||||
|
|
||||||
|
return noFrame, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
type messageReader struct{ c *Conn }
|
type messageReader struct{ c *Conn }
|
||||||
|
|
Loading…
Reference in New Issue