TODO 掉线重连机制 (待完成)
This commit is contained in:
parent
c02845ddc3
commit
dfdd9f442c
@ -172,7 +172,7 @@ namespace RIZO_Application.Modules.ModuleName.ViewModels
|
|||||||
_eventAggregator.GetEvent<SystemLogEvent>().Publish(message);
|
_eventAggregator.GetEvent<SystemLogEvent>().Publish(message);
|
||||||
if (retries>=maxRetries)
|
if (retries>=maxRetries)
|
||||||
{
|
{
|
||||||
MessageBox.Show("MQTT已掉线,请停止扫码");
|
MessageBox.Show("MQTT服务器已掉线,请停止扫码并重启系统");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public async void Destroy()
|
public async void Destroy()
|
||||||
|
|||||||
@ -25,7 +25,7 @@ namespace RIZO_Helper.Tools
|
|||||||
public Action<string, int, int> Disconnected;
|
public Action<string, int, int> Disconnected;
|
||||||
|
|
||||||
|
|
||||||
public MqttHelper(string server, int port = 1883, string clientId = "wpf-demo", bool cleanSession = true)
|
public MqttHelper(string server, int port = 1883, string clientId = "wpf-demo", bool cleanSession = false)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(server))
|
if (string.IsNullOrEmpty(server))
|
||||||
throw new ArgumentNullException(nameof(server), "MQTT服务器地址不能为空");
|
throw new ArgumentNullException(nameof(server), "MQTT服务器地址不能为空");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user