|
@@ -29,9 +29,7 @@ type Client struct {
|
|
|
|
|
|
readWait time.Duration // readWait 读超时
|
|
readWait time.Duration // readWait 读超时
|
|
writeWait time.Duration // writeWait 写超时
|
|
writeWait time.Duration // writeWait 写超时
|
|
-
|
|
|
|
- pingWait time.Duration
|
|
|
|
- pongWait time.Duration
|
|
|
|
|
|
+ pingWait time.Duration // pingWait 心跳超时
|
|
|
|
|
|
repos *repositories.Repositories
|
|
repos *repositories.Repositories
|
|
}
|
|
}
|
|
@@ -103,7 +101,7 @@ func (c *Client) reader() {
|
|
c.Send <- newReplyMessage(message)
|
|
c.Send <- newReplyMessage(message)
|
|
|
|
|
|
// Reset read dead line, prevent Reader from shutting down
|
|
// Reset read dead line, prevent Reader from shutting down
|
|
- c.UnderlyingConn.SetReadDeadline(time.Now().Add(c.pongWait))
|
|
|
|
|
|
+ c.UnderlyingConn.SetReadDeadline(time.Now().Add(c.pingWait))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|