From 546e8411d0a47784b00e20da8285860008dfd26a Mon Sep 17 00:00:00 2001 From: fyf Date: Fri, 13 May 2022 17:56:46 +0800 Subject: [PATCH] 3434 --- DataVAPI/UpAndDown/ProcessServer.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DataVAPI/UpAndDown/ProcessServer.cs b/DataVAPI/UpAndDown/ProcessServer.cs index f8e24b7..8c84f7f 100644 --- a/DataVAPI/UpAndDown/ProcessServer.cs +++ b/DataVAPI/UpAndDown/ProcessServer.cs @@ -46,6 +46,7 @@ namespace DataVAPI.UpAndDown orderProvider = new OrderProvider(); } #endregion + bool FistBOOL = false; /// /// 初始化 /// @@ -61,10 +62,12 @@ namespace DataVAPI.UpAndDown ConsoleHelper.WriteInfoLine("尝试连接阿里云."); if (IOTDevServer.GetInstance().CreateLinks(DataBus.ProductKey, DataBus.DeviceName, DataBus.DeviceSecret)) { + FistBOOL = true; ConsoleHelper.WriteSuccessLine($"阿里云【Transit】连接成功"); } else { + FistBOOL = false; ConsoleHelper.WriteSuccessLine($"阿里云【Transit】连接失败"); } //属性状态变xin @@ -96,7 +99,7 @@ namespace DataVAPI.UpAndDown { try { - if (!IOTDevServer.GetInstance().GetIsConnected()) + if (!FistBOOL) { if (IOTDevServer.GetInstance().CreateLinks(DataBus.ProductKey, DataBus.DeviceName, DataBus.DeviceSecret)) @@ -107,6 +110,7 @@ namespace DataVAPI.UpAndDown //订阅主播消息 Subscribe(IOTDevServer.BroadcastTopic); + FistBOOL=true; } else {