iosignal 9.14.0 → 9.21.0
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/README.ko.md +17 -3
- package/README.md +26 -3
- package/dist/browser/esm/io.d.ts +23 -0
- package/dist/browser/esm/io.js +3 -3
- package/dist/browser/esm/io.js.map +1 -1
- package/dist/browser/iife/io.js +3 -3
- package/dist/browser/iife/io.js.map +1 -1
- package/dist/node/iosignal.cjs +360 -53
- package/dist/node/iosignal.d.cts +69 -5
- package/dist/node/iosignal.d.ts +69 -5
- package/dist/node/iosignal.js +360 -54
- package/dist/types/client/IOCore.d.ts +23 -0
- package/dist/types/common/constants.d.ts +10 -0
- package/package.json +1 -1
|
@@ -63,6 +63,16 @@ export class IOCore extends EventEmitter<string | symbol, any> {
|
|
|
63
63
|
* @type {number}
|
|
64
64
|
*/
|
|
65
65
|
lastTxRxTime: number;
|
|
66
|
+
/**
|
|
67
|
+
* Last time anything was received from the server (see keepAlive()).
|
|
68
|
+
* @type {number}
|
|
69
|
+
*/
|
|
70
|
+
lastRxTime: number;
|
|
71
|
+
/** @private Time of a PING that has had no answer yet; 0 when none is pending. */
|
|
72
|
+
private _pingSentAt;
|
|
73
|
+
/** @private Connections closed since the last ready, and the earliest time of the next automatic attempt. */
|
|
74
|
+
private _reconnectAttempts;
|
|
75
|
+
_nextConnectAt: number;
|
|
66
76
|
/**
|
|
67
77
|
* Period for connection checker.
|
|
68
78
|
* @type {number}
|
|
@@ -182,11 +192,24 @@ export class IOCore extends EventEmitter<string | symbol, any> {
|
|
|
182
192
|
* is implemented keepConnection() in the child classes (IOWS, IOCongSocket, etc.).
|
|
183
193
|
*/
|
|
184
194
|
keepAlive(): void;
|
|
195
|
+
/** @private When keepAlive() may connect again after this close: see SIZE_LIMIT.RECONNECT_*. */
|
|
196
|
+
private scheduleReconnect;
|
|
197
|
+
/** @private True from the socket opening until it closes (any state a server message can arrive in). */
|
|
198
|
+
private isLinkUp;
|
|
185
199
|
/**
|
|
186
200
|
* Redirects the connection to a new URL.
|
|
187
201
|
* @param {string} url2 - The new URL to redirect to.
|
|
188
202
|
*/
|
|
189
203
|
redirect(url2: string): void;
|
|
204
|
+
/**
|
|
205
|
+
* Closes a connection that has not got the server's hello in SIZE_LIMIT.SERVER_HELLO_TIMEOUT
|
|
206
|
+
* (a server that cannot be reached, or a connection that opens but never answers). With
|
|
207
|
+
* autoReconnect the client then reconnects to this.url, so a failed redirect falls back to the
|
|
208
|
+
* original server, as the Arduino library does.
|
|
209
|
+
*/
|
|
210
|
+
armHelloTimer(): void;
|
|
211
|
+
helloTimerID: any;
|
|
212
|
+
clearHelloTimer(): void;
|
|
190
213
|
/**
|
|
191
214
|
* Opens the WebSocket connection.
|
|
192
215
|
* @param {string} [url] - Optional URL to connect to. If not provided, uses the instance's URL.
|
|
@@ -45,6 +45,11 @@ export type SIZE_LIMIT = {
|
|
|
45
45
|
TAG_LEN2: number;
|
|
46
46
|
CONNECTION_CHECKER_PERIOD: number;
|
|
47
47
|
CLIENT_PING_PERIOD: number;
|
|
48
|
+
PONG_TIMEOUT: number;
|
|
49
|
+
RECONNECT_JITTER: number;
|
|
50
|
+
RECONNECT_BASE: number;
|
|
51
|
+
RECONNECT_MAX: number;
|
|
52
|
+
SERVER_HELLO_TIMEOUT: number;
|
|
48
53
|
PROMISE_TIMEOUT: number;
|
|
49
54
|
DID: number;
|
|
50
55
|
CID: number;
|
|
@@ -54,6 +59,11 @@ export namespace SIZE_LIMIT {
|
|
|
54
59
|
let TAG_LEN2: number;
|
|
55
60
|
let CONNECTION_CHECKER_PERIOD: number;
|
|
56
61
|
let CLIENT_PING_PERIOD: number;
|
|
62
|
+
let PONG_TIMEOUT: number;
|
|
63
|
+
let RECONNECT_JITTER: number;
|
|
64
|
+
let RECONNECT_BASE: number;
|
|
65
|
+
let RECONNECT_MAX: number;
|
|
66
|
+
let SERVER_HELLO_TIMEOUT: number;
|
|
57
67
|
let PROMISE_TIMEOUT: number;
|
|
58
68
|
let DID: number;
|
|
59
69
|
let CID: number;
|