From e6a26ee148587327478d9a82624a820c907b6e16 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期三, 04 十一月 2020 14:58:15 +0800 Subject: [PATCH] 20201104 --- HDL_ON/DAL/Net/Mqtt_A_Protocol.cs | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/HDL_ON/DAL/Net/Mqtt_A_Protocol.cs b/HDL_ON/DAL/Net/Mqtt_A_Protocol.cs index b6e8b1b..d7dd0dd 100644 --- a/HDL_ON/DAL/Net/Mqtt_A_Protocol.cs +++ b/HDL_ON/DAL/Net/Mqtt_A_Protocol.cs @@ -15,6 +15,7 @@ // public static IMqttClient mqttClient_A; // public static string mqttClientIP; // public static string mqttGatewayMAC; +// public static string mqttGatewayName; // static bool remoteIsConnected; // static bool onConnection = false; @@ -73,7 +74,8 @@ // static void InitMqtt() // { -// new System.Threading.Thread(async () => { +// new System.Threading.Thread(async () => +// { // while (true) // { // try @@ -106,6 +108,7 @@ // onConnection = true; // new System.Threading.Thread(async () => // { +// MainPage.Log($"mqtt 绾跨▼鍚姩 : {DateTime.Now}"); // if (remoteIsConnected) // return; // try @@ -121,7 +124,8 @@ // MainPage.Log($"Des Topic={aesDecryptTopic}"); // }); -// mqttClient_A.UseConnectedHandler(async (e) => { +// mqttClient_A.UseConnectedHandler(async (e) => +// { // MainPage.Log("mqtt connected !!"); // onConnection = false; // }); @@ -131,7 +135,7 @@ // int readCount = 0; // BusSocket.Stop(); // System.Threading.Thread.Sleep(1000); -// BusSocket.Start(6688); +// BusSocket.Start(); // System.Threading.Thread.Sleep(1000); // Control.ReadGatewayIPAddress(); // while (true) @@ -152,13 +156,13 @@ // } // } // BusSocket.Stop(); -// System.Threading.Thread.Sleep(1000); -// BusSocket.Start(6000); -// System.Threading.Thread.Sleep(1000); +// //System.Threading.Thread.Sleep(1000); +// //BusSocket.Start(6000); +// //System.Threading.Thread.Sleep(1000); // var options = new MqttClientOptionsBuilder()//MQTT杩炴帴鍙傛暟濉厖 // .WithClientId(Guid.NewGuid().ToString().Substring(0, 5))//瀹㈡埛绔疘D -// .WithTcpServer(mqttClientIP, 1883)//MQTTServerIP.Text, Int32.Parse(MQTTServerPort.Text.ToString()))//TCP鏈嶅姟绔� 1883 锛屽嵆MQTT鏈嶅姟绔� +// .WithTcpServer(mqttClientIP, 8586)//MQTTServerIP.Text, Int32.Parse(MQTTServerPort.Text.ToString()))//TCP鏈嶅姟绔� 1883 锛屽嵆MQTT鏈嶅姟绔� // .WithCredentials("", "")//"", "")//鍑瘉 甯愬彿 瀵嗙爜 // .WithCommunicationTimeout(new TimeSpan(0, 0, 60)) //閲嶈繛瓒呮椂鏃堕棿锛岄粯璁�5s // .WithKeepAlivePeriod(new TimeSpan(0, 0, 15)) //淇濇寔杩炴帴鏃堕棿锛岄粯璁�5s锛屽績璺冲寘 -- Gitblit v1.8.0