fix: deadline no need to multiply

This commit is contained in:
lyyyuna 2021-06-21 22:37:33 +08:00
parent b3e9d7dd78
commit 4ebf9ee517

View File

@ -108,11 +108,11 @@ func (gs *gocServer) serveRpcStream(c *gin.Context) {
}
func (gs *gocServer) wsping(ws *websocket.Conn, deadline time.Duration) error {
return ws.WriteControl(websocket.PingMessage, []byte{}, time.Now().Add(deadline*time.Second))
return ws.WriteControl(websocket.PingMessage, []byte{}, time.Now().Add(deadline))
}
func (gs *gocServer) wsclose(ws *websocket.Conn, deadline time.Duration) error {
return ws.WriteControl(websocket.CloseMessage, []byte{}, time.Now().Add(deadline*time.Second))
return ws.WriteControl(websocket.CloseMessage, []byte{}, time.Now().Add(deadline))
}
// generateClientId generate id based on client's meta infomation