diff --git a/conn.go b/conn.go index 92654a1..30a5f64 100644 --- a/conn.go +++ b/conn.go @@ -16,6 +16,7 @@ import ( "sync" "time" "unicode/utf8" + "strings" ) const ( @@ -1029,6 +1030,9 @@ func (c *Conn) ReadMessage() (messageType int, p []byte, err error) { // all future reads will return an error. A zero value for t means reads will // not time out. func (c *Conn) SetReadDeadline(t time.Time) error { + if c.readErr != nil && strings.Contains(c.readErr.Error(), "i/o timeout") { + c.readErr = nil + } return c.conn.SetReadDeadline(t) }