From 59edb394fa6437e8502cfb48a1905a0d0098fc8a Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 25 Jul 2023 19:37:56 +0800 Subject: [PATCH] fix --- server/websocket/internal/handler/datatransferhandler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/websocket/internal/handler/datatransferhandler.go b/server/websocket/internal/handler/datatransferhandler.go index 7c8a6c5b..050f84ad 100644 --- a/server/websocket/internal/handler/datatransferhandler.go +++ b/server/websocket/internal/handler/datatransferhandler.go @@ -119,6 +119,7 @@ func (w *wsConnectItem) heartbeat() { T: constants.WEBSOCKET_HEARTBEAT, D: "", } + b, _ := json.Marshal(rsp) for { time.Sleep(time.Second * 10) select { @@ -128,7 +129,6 @@ func (w *wsConnectItem) heartbeat() { } //发送心跳信息 - b, _ := json.Marshal(rsp) if err := w.conn.WriteMessage(websocket.TextMessage, b); err != nil { logx.Error("发送心跳信息异常,关闭连接:", w.flag, err) w.close()