liuxiaolong
2020-12-21 6c3c6bbba02e76b8cb652516529698117a526d90
发送Heartbeat信息封装成MsgInfo
1个文件已修改
11 ■■■■■ 已修改文件
hbusc.go 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hbusc.go
@@ -289,7 +289,16 @@
func (h *BHBus) HeartBeat(info *HeartBeatInfo) error {
    data, err := json.Marshal(*info)
    if err == nil {
        return h.send2(h.sockHB, data, h.conf.sendTimeOut)
        hbd,err := json.Marshal(MsgInfo{
            MsgType: "",
            Topic:   TOPIC_HEARTBEAT,
            Body:    data,
        })
        if err != nil {
            h.printLog("marshal heartbeat msgInfo err:", err)
            return err
        }
        return h.send2(h.sockHB, hbd, h.conf.sendTimeOut)
    }
    return err
}