client/client.go
@@ -22,8 +22,6 @@ DefaultHeartbeatInterval = 15 * time.Second // 读取数据超时时间 DefaultReaderTimeOut = 60 * time.Second // 连接尝试间隔 DefaultNetRetry = 10 * time.Second ) // 连接状态 @@ -37,8 +35,6 @@ // 已断开 StateDisconnected ) var syncReq map[string]chan *aiot.Protocol // 连接状态 type State int32 @@ -233,7 +229,7 @@ } // 发送消息 c.WriteBody(body) _ = c.WriteBody(body) return body, nil } @@ -457,7 +453,7 @@ defer c.closeLock.Unlock() // 关闭通道 if !c.IsClosed() { c.Conn.Close() _ = c.Conn.Close() if c.IsConnected() { c.clientCallback.OnClose(c) }