|
@@ -35,8 +35,10 @@ class Client {
|
35
|
35
|
throw new Error('asyncSend: connection refuse');
|
36
|
36
|
}
|
37
|
37
|
|
|
38
|
+ const heartbeatOperator = 0;
|
|
39
|
+
|
38
|
40
|
this.listeners.set(
|
39
|
|
- 0,
|
|
41
|
+ heartbeatOperator,
|
40
|
42
|
(data: string): void => {
|
41
|
43
|
const code = this.getResponseProperty('code');
|
42
|
44
|
if (code !== '') {
|
|
@@ -51,7 +53,9 @@ class Client {
|
51
|
53
|
);
|
52
|
54
|
|
53
|
55
|
const p = new Packet();
|
54
|
|
- this.send(p.pack(0, 0, this.requestHeader, JSON.stringify(param)));
|
|
56
|
+ this.send(
|
|
57
|
+ p.pack(heartbeatOperator, 0, this.requestHeader, JSON.stringify(param)),
|
|
58
|
+ );
|
55
|
59
|
}
|
56
|
60
|
|
57
|
61
|
send(data: ArrayBuffer) {
|