|
@@ -33,7 +33,7 @@ type Response struct {
|
|
|
UUID string `json:"uuid"`
|
|
|
}
|
|
|
|
|
|
-// 状态消息 结构体定义
|
|
|
+// StatusMessage 状态消息 结构体定义
|
|
|
type StatusMessage struct {
|
|
|
Type string `json:"type"`
|
|
|
Topic string `json:"topic"`
|
|
@@ -69,7 +69,7 @@ func keepAlive() {
|
|
|
c_log.GlobalLogger.Error("保持websocket连接活跃,获取心跳响应 - 失败。", err)
|
|
|
continue
|
|
|
}
|
|
|
- c_log.GlobalLogger.Error("保持websocket连接活跃,发送心跳请求 - 成功。", err)
|
|
|
+ c_log.GlobalLogger.Info("保持websocket连接活跃,发送心跳请求 - 成功。", err)
|
|
|
// 将响应字节解码为JSON
|
|
|
var responseMessage Response
|
|
|
err = json.Unmarshal(msg, &responseMessage)
|
|
@@ -77,6 +77,7 @@ func keepAlive() {
|
|
|
c_log.GlobalLogger.Error("保持websocket连接活跃,解析心跳响应为json - 失败。", err)
|
|
|
continue
|
|
|
}
|
|
|
+ c_log.GlobalLogger.Info("websocket发送心跳请求解析状态为", responseMessage.Status)
|
|
|
if responseMessage.Status != "OK" {
|
|
|
WsConn.Close()
|
|
|
c_log.GlobalLogger.Info("重试连接websocket...")
|