saas-smartAi通信协议标准库
gongshangguo
2022-03-01 14c25a6be6d147f90011d0218380bf7cd58b76e5
关闭的通道禁止写入
1个文件已修改
7 ■■■■■ 已修改文件
client/client.go 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
client/client.go
@@ -6,6 +6,7 @@
    "bufio"
    "encoding/binary"
    "encoding/json"
    "errors"
    uuid "github.com/satori/go.uuid"
    "go.uber.org/zap"
    "io"
@@ -239,6 +240,12 @@
            c.Logger.Error("Write Body Error:", err)
        }
    }()
    if c.IsClosed() {
        errMsg := "Can not write msg into closed chain"
        c.Logger.Warn(errMsg, zap.Any("msg",body))
        return errors.New(errMsg)
    }
    body.Receiver = aiot.RECEIVER_TO_SAAS
    msgData, err := json.Marshal(body)
    if err != nil {