mm_os 2.3.6 → 2.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/com/mqtt/index.js +4 -2
- package/package.json +1 -1
package/core/com/mqtt/index.js
CHANGED
|
@@ -38,8 +38,10 @@ class MQTT extends Index {
|
|
|
38
38
|
longtime: 15000,
|
|
39
39
|
// 在线有效期时长判断 单位:毫秒,150000毫秒为2.5分钟
|
|
40
40
|
online_expires: 150000,
|
|
41
|
+
// 在线有效期检测间隔
|
|
41
42
|
online_interval: 10000,
|
|
42
|
-
|
|
43
|
+
// 连接超时
|
|
44
|
+
connectTimeout: 6000,
|
|
43
45
|
// maxInflight: 20,
|
|
44
46
|
// 重连间隔
|
|
45
47
|
// interval: 6000,
|
|
@@ -107,7 +109,7 @@ MQTT.prototype.match = function(topic, top) {
|
|
|
107
109
|
if (topic === top) {
|
|
108
110
|
return true;
|
|
109
111
|
}
|
|
110
|
-
var str = "^" + top.replace("#", ".*").replace("+", "~~~").replace("~~~", "[a-zA-Z0-9_]+").replace("$", "~~~")
|
|
112
|
+
var str = "^" + top.replace("#", ".*").replace("+", "~~~").replace("~~~", "[a-zA-Z0-9_-]+").replace("$", "~~~")
|
|
111
113
|
.replace("~~~", "\\$");
|
|
112
114
|
var s = str.substring(str.length - 1, str.length);
|
|
113
115
|
if (s !== "#") {
|