From bff8993501334c4f3c5f902216fe03253be747f8 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期三, 15 四月 2020 16:59:01 +0800
Subject: [PATCH] 合并新代码
---
ZigbeeApp20200414/Shared/Phone/ZigBee/Device/ZbGateway.cs | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/ZbGateway.cs b/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/ZbGateway.cs
index ca05683..70c8b3d 100755
--- a/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/ZbGateway.cs
+++ b/ZigbeeApp20200414/Shared/Phone/ZigBee/Device/ZbGateway.cs
@@ -3130,14 +3130,14 @@
{
if (localMqttClient.Options == null)
{
- var options = new MQTTnet.Client.Options.MqttClientOptionsBuilder().WithClientId(currentGuid.ToString())
- .WithTcpServer(brokerName, 1883)
- .WithKeepAlivePeriod(TimeSpan.FromSeconds(20))
- .WithCleanSession()
- //.WithCommunicationTimeout(TimeSpan.FromSeconds(10))
- .WithCredentials("", "")
- .Build();
- await localMqttClient.ConnectAsync(options, CancellationToken.None);
+ var options = new MQTTnet.Client.Options.MqttClientOptionsBuilder()//MQTT杩炴帴鍙傛暟濉厖
+ .WithClientId(currentGuid.ToString())//瀹㈡埛绔疘D
+ .WithTcpServer(brokerName, 1883)//TCP鏈嶅姟绔� 1883 锛屽嵆MQTT鏈嶅姟绔�
+ .WithCredentials("", "")//"", "")//鍑瘉 甯愬彿 瀵嗙爜
+ .WithCommunicationTimeout(new TimeSpan(0, 0, 60)) //閲嶈繛瓒呮椂鏃堕棿锛岄粯璁�5s
+ .WithKeepAlivePeriod(new TimeSpan(0, 0, 15)) //淇濇寔杩炴帴鏃堕棿锛岄粯璁�5s锛屽績璺冲寘
+ .Build();//
+ await localMqttClient.ConnectAsync(options);
}
else
{
--
Gitblit v1.8.0