mqtt增加心跳间隔应对网络波动
This commit is contained in:
@ -191,7 +191,8 @@ class MqttClient {
|
||||
|
||||
try {
|
||||
const connectOptions = {
|
||||
timeout: 4,
|
||||
timeout: 10, // 增加连接超时时间,应对网络波动
|
||||
keepAliveInterval: 30, // 明确设置心跳间隔为30秒
|
||||
userName: this.options.username,
|
||||
password: this.options.password,
|
||||
useSSL: false,
|
||||
|
Reference in New Issue
Block a user