@atomiqlabs/chain-evm 1.0.0-dev.52 → 1.0.0-dev.53
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.
|
@@ -16,10 +16,11 @@ class ReconnectingWebSocketProvider extends SocketProvider_1.SocketProvider {
|
|
|
16
16
|
this._connected();
|
|
17
17
|
this._start();
|
|
18
18
|
this.pingInterval = setInterval(() => {
|
|
19
|
-
this.websocket.
|
|
19
|
+
this.websocket.send('');
|
|
20
20
|
}, this.pingIntervalSeconds * 1000);
|
|
21
21
|
};
|
|
22
22
|
this.websocket.onerror = (err) => {
|
|
23
|
+
console.error(`Websocket connection error: `, err);
|
|
23
24
|
if (this.destroyed)
|
|
24
25
|
return;
|
|
25
26
|
this.websocket = null;
|
|
@@ -27,13 +28,14 @@ class ReconnectingWebSocketProvider extends SocketProvider_1.SocketProvider {
|
|
|
27
28
|
clearInterval(this.pingInterval);
|
|
28
29
|
//Fail all in-flight requests
|
|
29
30
|
this._disconnected();
|
|
30
|
-
console.error(`
|
|
31
|
+
console.error(`Retrying in ${this.reconnectSeconds} seconds...`);
|
|
31
32
|
this.reconnectTimer = setTimeout(() => this.connect(), this.reconnectSeconds * 1000);
|
|
32
33
|
};
|
|
33
34
|
this.websocket.onmessage = (message) => {
|
|
34
35
|
this._processMessage(message.data);
|
|
35
36
|
};
|
|
36
37
|
this.websocket.onclose = (event) => {
|
|
38
|
+
console.error(`Websocket connection closed: `, event);
|
|
37
39
|
if (this.destroyed)
|
|
38
40
|
return;
|
|
39
41
|
this.websocket = null;
|
|
@@ -41,7 +43,7 @@ class ReconnectingWebSocketProvider extends SocketProvider_1.SocketProvider {
|
|
|
41
43
|
clearInterval(this.pingInterval);
|
|
42
44
|
//Fail all in-flight requests
|
|
43
45
|
this._disconnected();
|
|
44
|
-
console.error(`
|
|
46
|
+
console.error(`Retrying in ${this.reconnectSeconds} seconds...`);
|
|
45
47
|
this.reconnectTimer = setTimeout(() => this.connect(), this.reconnectSeconds * 1000);
|
|
46
48
|
};
|
|
47
49
|
}
|
package/package.json
CHANGED
|
@@ -28,11 +28,12 @@ export class ReconnectingWebSocketProvider extends SocketProvider {
|
|
|
28
28
|
this._start();
|
|
29
29
|
|
|
30
30
|
this.pingInterval = setInterval(() => {
|
|
31
|
-
this.websocket.
|
|
31
|
+
this.websocket.send('');
|
|
32
32
|
}, this.pingIntervalSeconds * 1000);
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
this.websocket.onerror = (err) => {
|
|
36
|
+
console.error(`Websocket connection error: `, err);
|
|
36
37
|
if(this.destroyed) return;
|
|
37
38
|
this.websocket = null;
|
|
38
39
|
if(this.pingInterval!=null) clearInterval(this.pingInterval);
|
|
@@ -40,7 +41,7 @@ export class ReconnectingWebSocketProvider extends SocketProvider {
|
|
|
40
41
|
//Fail all in-flight requests
|
|
41
42
|
this._disconnected();
|
|
42
43
|
|
|
43
|
-
console.error(`
|
|
44
|
+
console.error(`Retrying in ${this.reconnectSeconds} seconds...`);
|
|
44
45
|
this.reconnectTimer = setTimeout(() => this.connect(), this.reconnectSeconds * 1000);
|
|
45
46
|
};
|
|
46
47
|
|
|
@@ -49,6 +50,7 @@ export class ReconnectingWebSocketProvider extends SocketProvider {
|
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
this.websocket.onclose = (event) => {
|
|
53
|
+
console.error(`Websocket connection closed: `, event);
|
|
52
54
|
if(this.destroyed) return;
|
|
53
55
|
this.websocket = null;
|
|
54
56
|
if(this.pingInterval!=null) clearInterval(this.pingInterval);
|
|
@@ -56,7 +58,7 @@ export class ReconnectingWebSocketProvider extends SocketProvider {
|
|
|
56
58
|
//Fail all in-flight requests
|
|
57
59
|
this._disconnected();
|
|
58
60
|
|
|
59
|
-
console.error(`
|
|
61
|
+
console.error(`Retrying in ${this.reconnectSeconds} seconds...`);
|
|
60
62
|
this.reconnectTimer = setTimeout(() => this.connect(), this.reconnectSeconds * 1000);
|
|
61
63
|
};
|
|
62
64
|
}
|