vim-web 0.3.42-dev.0 → 0.3.42-dev.2
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.
|
@@ -4,7 +4,7 @@ import { ILogger } from './logger';
|
|
|
4
4
|
export declare const DEFAULT_LOCAL_ULTRA_SERVER_URL = "ws://localhost:8123";
|
|
5
5
|
export type ConnectionSettings = {
|
|
6
6
|
url?: string;
|
|
7
|
-
|
|
7
|
+
retries?: number;
|
|
8
8
|
};
|
|
9
9
|
export type ClientState = ClientStateConnecting | ClientStateConnected | ClientStateDisconnected | ClientStateValidating | ClientError;
|
|
10
10
|
export type ClientError = ClientStateCompatibilityError | ClientStateConnectionError | ClientStreamError;
|
|
@@ -58,7 +58,7 @@ export declare class SocketClient {
|
|
|
58
58
|
private _rpcCallId;
|
|
59
59
|
private _reconnectTimeout;
|
|
60
60
|
private _connectionTimeout;
|
|
61
|
-
private
|
|
61
|
+
private _retries;
|
|
62
62
|
private _validateConnection;
|
|
63
63
|
/**
|
|
64
64
|
* Callback function to handle incoming video frames.
|
package/dist/vim-web.iife.js
CHANGED
|
@@ -59735,7 +59735,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
59735
59735
|
__publicField(this, "_rpcCallId", 0);
|
|
59736
59736
|
__publicField(this, "_reconnectTimeout");
|
|
59737
59737
|
__publicField(this, "_connectionTimeout");
|
|
59738
|
-
__publicField(this, "
|
|
59738
|
+
__publicField(this, "_retries", -1);
|
|
59739
59739
|
__publicField(this, "_validateConnection");
|
|
59740
59740
|
/**
|
|
59741
59741
|
* Callback function to handle incoming video frames.
|
|
@@ -59789,7 +59789,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
59789
59789
|
connect(settings2) {
|
|
59790
59790
|
settings2 = {
|
|
59791
59791
|
url: (settings2 == null ? void 0 : settings2.url) ?? DEFAULT_LOCAL_ULTRA_SERVER_URL,
|
|
59792
|
-
|
|
59792
|
+
retries: (settings2 == null ? void 0 : settings2.retries) ?? 0
|
|
59793
59793
|
};
|
|
59794
59794
|
const url = settings2.url;
|
|
59795
59795
|
if (!isWebSocketUrl(url)) {
|
|
@@ -59802,12 +59802,11 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
59802
59802
|
} else {
|
|
59803
59803
|
this._clearSocket();
|
|
59804
59804
|
this._connectPromise.reject("Connection to a different server");
|
|
59805
|
-
this._connectPromise = new ControllablePromise();
|
|
59806
59805
|
}
|
|
59807
|
-
} else if (this._connectingUrl !== url) {
|
|
59808
|
-
this._connectPromise = new ControllablePromise();
|
|
59809
|
-
this._connectingUrl = url;
|
|
59810
59806
|
}
|
|
59807
|
+
this._connectPromise = new ControllablePromise();
|
|
59808
|
+
this._connectingUrl = settings2.url;
|
|
59809
|
+
this._retries = settings2.retries;
|
|
59811
59810
|
this.updateState({ status: "connecting" });
|
|
59812
59811
|
try {
|
|
59813
59812
|
this._socket = new WebSocket(url);
|
|
@@ -59933,13 +59932,13 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
59933
59932
|
clearTimeout(this._connectionTimeout);
|
|
59934
59933
|
this._disconnect({ status: "error", error: "connection", serverUrl: this._connectingUrl });
|
|
59935
59934
|
this._logger.log("WebSocket closed.");
|
|
59936
|
-
if (this.
|
|
59935
|
+
if (this._retries !== 0) {
|
|
59937
59936
|
this._logger.log("Attempting to reconnect in 5 seconds");
|
|
59938
59937
|
this._reconnectTimeout = setTimeout(() => {
|
|
59939
59938
|
this.updateState({ status: "connecting" });
|
|
59940
59939
|
this.connect({
|
|
59941
59940
|
url: this._connectingUrl,
|
|
59942
|
-
|
|
59941
|
+
retries: this._retries - 1
|
|
59943
59942
|
});
|
|
59944
59943
|
}, 5e3);
|
|
59945
59944
|
}
|