fix: deadline no need to multiply
This commit is contained in:
parent
b3e9d7dd78
commit
4ebf9ee517
@ -108,11 +108,11 @@ func (gs *gocServer) serveRpcStream(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (gs *gocServer) wsping(ws *websocket.Conn, deadline time.Duration) error {
|
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 {
|
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
|
// generateClientId generate id based on client's meta infomation
|
||||||
|
Loading…
Reference in New Issue
Block a user