jsgar 1.5.4 → 1.6.1
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/gar.umd.js +5 -5
- package/package.json +1 -1
package/dist/gar.umd.js
CHANGED
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
* Initialize the GAR client.
|
|
38
38
|
* @param {string} wsEndpoint - WebSocket endpoint (e.g., "ws://localhost:8765")
|
|
39
39
|
* @param {string} user - Client username for identification
|
|
40
|
-
* @param {number} [
|
|
40
|
+
* @param {number} [heartbeatTimeoutInterval=4000] - Heartbeat interval in milliseconds
|
|
41
41
|
* @param {boolean} [allowSelfSignedCertificate=false] - Allow self-signed certificates
|
|
42
42
|
* @param {string} [logLevel='INFO'] - Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
|
|
43
43
|
*/
|
|
44
|
-
constructor(wsEndpoint, user, working_namespace = null,
|
|
44
|
+
constructor(wsEndpoint, user, working_namespace = null, heartbeatTimeoutInterval = 4000, allowSelfSignedCertificate = false, logLevel = 'INFO') {
|
|
45
45
|
this.wsEndpoint = wsEndpoint;
|
|
46
46
|
this.websocket = null;
|
|
47
47
|
this.messageQueue = [];
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
this.reconnectDelay = 5000; // Milliseconds
|
|
50
50
|
this.user = user;
|
|
51
51
|
this.working_namespace = working_namespace;
|
|
52
|
-
this.
|
|
52
|
+
this.heartbeatTimeoutInterval = heartbeatTimeoutInterval;
|
|
53
53
|
this.version = 650269;
|
|
54
54
|
|
|
55
55
|
if (typeof window !== 'undefined' && window.location) {
|
|
@@ -432,13 +432,13 @@
|
|
|
432
432
|
message_type: 'Introduction',
|
|
433
433
|
value: {
|
|
434
434
|
version: this.version,
|
|
435
|
-
heartbeat_timeout_interval: this.
|
|
435
|
+
heartbeat_timeout_interval: this.heartbeatTimeoutInterval,
|
|
436
436
|
user: this.user,
|
|
437
437
|
working_namespace: this.working_namespace
|
|
438
438
|
}
|
|
439
439
|
};
|
|
440
440
|
this.sendMessage(introMsg);
|
|
441
|
-
this.heartbeatIntervalId = setInterval(() => this._heartbeatLoop(), this.
|
|
441
|
+
this.heartbeatIntervalId = setInterval(() => this._heartbeatLoop(), this.heartbeatTimeoutInterval / 2);
|
|
442
442
|
this.connect();
|
|
443
443
|
}
|
|
444
444
|
|