From e327510c7329aa9a95e62a460ec659ea0c9563ad Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期六, 19 十二月 2020 19:05:47 +0800
Subject: [PATCH] Merge branch 'CJL' into NewFilePath

---
 HDL_ON/DAL/Mqtt/MqttClient.cs |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs
old mode 100755
new mode 100644
index 4ddfc8e..1606485
--- a/HDL_ON/DAL/Mqtt/MqttClient.cs
+++ b/HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -119,7 +119,7 @@
         /// <summary>
         /// 澶栫綉鐨凪QTT鏄惁姝e湪杩炴帴
         /// </summary>
-        public static bool remoteMqttIsConnecting;
+        public static bool RemoteMqttIsConnecting;
         static bool remoteIsConnected;
 
         static MqttClient()
@@ -138,6 +138,8 @@
                     {
                         System.Threading.Thread.Sleep(500);
                         if (!Control.Ins.IsRemote) continue;
+                        //杩涘叆鍚庡彴涓嶅鐞�
+                        if (MainPage.IsEnterBackground) continue;
 
                         await StartCloudMqtt();
                         await SubscribeTopics();
@@ -221,7 +223,7 @@
             }
 
             //杩藉姞锛氭病鏈夎繙绋嬭繛鎺ョ殑鏉冮檺
-            if (remoteMqttIsConnecting || remoteIsConnected)
+            if (RemoteMqttIsConnecting || remoteIsConnected)
             {
                 return;
             }
@@ -232,7 +234,7 @@
                 try
                 {
                     #region 鍒濆鍖栬繙绋婱qtt
-                    remoteMqttIsConnecting = true;
+                    RemoteMqttIsConnecting = true;
                     RemoteMqttClient = new MqttFactory().CreateMqttClient();
 
 
@@ -357,7 +359,7 @@
                 finally
                 {
                     //鏈�缁堣閲婃斁杩炴帴鐘舵��
-                    remoteMqttIsConnecting = false;
+                    RemoteMqttIsConnecting = false;
 
                     Utlis.WriteLine($"StartCloudMqtt: 缁撴潫");
                 }

--
Gitblit v1.8.0