xm
2020-05-08 6bca8fcd37a48808a0b9c9342fc1be0adddfece6
ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs
old mode 100644 new mode 100755
@@ -101,7 +101,7 @@
            }
        }
        #region variable
        #region variable
        /// <summary>
        /// 远程连接成功时的时间
        /// </summary>
@@ -2857,8 +2857,8 @@
        /// <summary>
        /// 远程MqttClient
        /// </summary>
        public static IMqttClient RemoteMqttClient = new MqttFactory().CreateMqttClient();
        static bool remoteIsConnected;
        public static IMqttClient RemoteMqttClient= new MqttFactory().CreateMqttClient();
        static bool remoteIsConnected;
        private int IsLogin = 0;
        [Newtonsoft.Json.JsonIgnore]
        static Action actionTemp;
@@ -3051,8 +3051,8 @@
           .WithTcpServer(domain, int.Parse(port))
           .WithCredentials(connEmqUserName, connEmqPwd)
           .WithKeepAlivePeriod(TimeSpan.FromSeconds(20))
           .WithCleanSession()
           //.WithCommunicationTimeout(TimeSpan.FromSeconds(10))
           .WithCleanSession()
           //.WithCommunicationTimeout(TimeSpan.FromSeconds(10))
           .Build();
                                await DisConnectRemoteMqttClient("StartRemoteMqtt");
                                await RemoteMqttClient.ConnectAsync(options, CancellationToken.None);
@@ -3087,7 +3087,7 @@
                    localIsConnected = false;
                    DebugPrintLog($"Local主动断开_{s}");
                    //await localMqttClient.DisconnectAsync(new MQTTnet.Client.Disconnecting.MqttClientDisconnectOptions {  }, CancellationToken.None);
                    await localMqttClient.DisconnectAsync();
                    await localMqttClient.DisconnectAsync();
                }
            }
            catch (Exception ex)
@@ -3099,7 +3099,7 @@
        /// <summary>
        /// 断开远程Mqtt的链接
        /// </summary>
        public static async System.Threading.Tasks.Task DisConnectRemoteMqttClient(string s = "")
        public static async System.Threading.Tasks.Task DisConnectRemoteMqttClient(string s="")
        {
            try
            {
@@ -3218,7 +3218,7 @@
                        {
                            await localMqttClient.PublishAsync(new MqttApplicationMessage { Topic = topic, Payload = message, QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.ExactlyOnce, Retain = retain });
                        }
                        catch (Exception e)
                        catch(Exception e)
                        {
                            DebugPrintLog($"Local主动断开_{e.Message}");
                            await DisConnectLocalMqttClient(e.Message);
@@ -3424,7 +3424,7 @@
        /// <param name="topic">Topic.</param>
        /// <param name="message">Message.</param>
        /// <param name="e">E.</param>
        static void ReceiveMessage(string topic, string message, byte[] payload)
        static void ReceiveMessage(string topic, string message, byte []payload)
        {
            try
            {