fix
This commit is contained in:
parent
857a632cea
commit
636bc0aee7
|
@ -148,6 +148,8 @@ func (w *wsConnectItem) heartbeat() {
|
||||||
case <-w.closeChan:
|
case <-w.closeChan:
|
||||||
return
|
return
|
||||||
case <-tick:
|
case <-tick:
|
||||||
|
//设置写超时时间10s
|
||||||
|
_ = w.conn.SetWriteDeadline(time.Now().Add(time.Second * 10))
|
||||||
//发送心跳信息
|
//发送心跳信息
|
||||||
if err := w.conn.WriteMessage(websocket.PongMessage, nil); err != nil {
|
if err := w.conn.WriteMessage(websocket.PongMessage, nil); err != nil {
|
||||||
logx.Error("发送心跳信息异常,关闭连接:", w.flag, err)
|
logx.Error("发送心跳信息异常,关闭连接:", w.flag, err)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user