| | |
| | | } |
| | | } |
| | | |
| | | #region variable |
| | | #region variable |
| | | /// <summary> |
| | | /// 远程连接成功时的时间 |
| | | /// </summary> |
| | |
| | | /// 远程MqttClient |
| | | /// </summary> |
| | | public static IMqttClient RemoteMqttClient= new MqttFactory().CreateMqttClient(); |
| | | static bool remoteIsConnected; |
| | | static bool remoteIsConnected; |
| | | private int IsLogin = 0; |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | static Action actionTemp; |
| | |
| | | localIsConnected = false;
|
| | | DebugPrintLog($"Local主动断开_{s}");
|
| | | //await localMqttClient.DisconnectAsync(new MQTTnet.Client.Disconnecting.MqttClientDisconnectOptions { }, CancellationToken.None);
|
| | | await localMqttClient.DisconnectAsync();
|
| | | await localMqttClient.DisconnectAsync(); |
| | | }
|
| | | } |
| | | catch (Exception ex) |
| | |
| | | await RemoteMqttClient.DisconnectAsync();
|
| | | }
|
| | | }
|
| | | catch(Exception e) {
|
| | | catch(Exception e) { |
| | | DebugPrintLog($"Remote断开通讯连接出异常:{e.Message}");
|
| | | }
|
| | | } |