ztxkutils 2.7.11 → 2.7.12
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/dist/stompClient.js +30 -2
- package/package.json +1 -1
package/dist/stompClient.js
CHANGED
@@ -32,6 +32,14 @@ var StompClient = /** @class */ (function () {
|
|
32
32
|
clearTimeout(this.clearIsClient);
|
33
33
|
this.clearIsClient = null;
|
34
34
|
}
|
35
|
+
if (this.clearIsClientNo) {
|
36
|
+
clearTimeout(this.clearIsClientNo);
|
37
|
+
this.clearIsClientNo = null;
|
38
|
+
}
|
39
|
+
if (this.clearIsClientYes) {
|
40
|
+
clearTimeout(this.clearIsClientYes);
|
41
|
+
this.clearIsClientYes = null;
|
42
|
+
}
|
35
43
|
this.clearIsClient = setTimeout(function () {
|
36
44
|
_this.clearIsClient = null;
|
37
45
|
if (!_this.isClient) {
|
@@ -50,7 +58,11 @@ var StompClient = /** @class */ (function () {
|
|
50
58
|
_this.reconnectionNum++;
|
51
59
|
var timeInterval = 3000;
|
52
60
|
console.log("---\u7B2C" + _this.reconnectionNum + "\u6B21\u91CD\u8FDE\uFF01---");
|
53
|
-
|
61
|
+
if (_this.clearIsClientNo) {
|
62
|
+
clearTimeout(_this.clearIsClientNo);
|
63
|
+
_this.clearIsClientNo = null;
|
64
|
+
}
|
65
|
+
_this.clearIsClientNo = setTimeout(function () {
|
54
66
|
_this.init();
|
55
67
|
}, timeInterval > 10000 ? 10000 : timeInterval);
|
56
68
|
}
|
@@ -74,6 +86,14 @@ var StompClient = /** @class */ (function () {
|
|
74
86
|
clearTimeout(_this.clearIsClient);
|
75
87
|
_this.clearIsClient = null;
|
76
88
|
}
|
89
|
+
if (_this.clearIsClientNo) {
|
90
|
+
clearTimeout(_this.clearIsClientNo);
|
91
|
+
_this.clearIsClientNo = null;
|
92
|
+
}
|
93
|
+
if (_this.clearIsClientYes) {
|
94
|
+
clearTimeout(_this.clearIsClientYes);
|
95
|
+
_this.clearIsClientYes = null;
|
96
|
+
}
|
77
97
|
_this.reconnectionNum = 0;
|
78
98
|
console.log('---------连接成功--------');
|
79
99
|
// 连接成功后,将当前已注册的,未执行的 连接通道 连接
|
@@ -115,6 +135,14 @@ var StompClient = /** @class */ (function () {
|
|
115
135
|
clearTimeout(_this.clearIsClient);
|
116
136
|
_this.clearIsClient = null;
|
117
137
|
}
|
138
|
+
if (_this.clearIsClientNo) {
|
139
|
+
clearTimeout(_this.clearIsClientNo);
|
140
|
+
_this.clearIsClientNo = null;
|
141
|
+
}
|
142
|
+
if (_this.clearIsClientYes) {
|
143
|
+
clearTimeout(_this.clearIsClientYes);
|
144
|
+
_this.clearIsClientYes = null;
|
145
|
+
}
|
118
146
|
// this.errorCallback(err);
|
119
147
|
// 连接失败后,将当前已注册的 连接通道 全部置为未执行状态
|
120
148
|
var subscriptionsFnKeys = Object.keys(_this.subscriptionsFn);
|
@@ -160,7 +188,7 @@ var StompClient = /** @class */ (function () {
|
|
160
188
|
// (this.connectWsConfig.reconnectionTime ?? 3000);
|
161
189
|
var timeInterval = 3000;
|
162
190
|
console.log("---\u7B2C" + _this.reconnectionNum + "\u6B21\u91CD\u8FDE\uFF01");
|
163
|
-
setTimeout(function () {
|
191
|
+
_this.clearIsClientYes = setTimeout(function () {
|
164
192
|
_this.init();
|
165
193
|
}, timeInterval);
|
166
194
|
});
|