@momo2555/koppeliajs 0.0.102 → 0.0.103

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.
@@ -9,6 +9,7 @@ export declare class KoppeliaWebsocket {
9
9
  onGoingRequests: OnGoingRequest[];
10
10
  timeout: number;
11
11
  receiveCallbacks: Callback[];
12
+ websocketUrl: string;
12
13
  openCallback?: () => void;
13
14
  /**
14
15
  * Constructor of the Koppelia websocket class
@@ -5,6 +5,7 @@ export class KoppeliaWebsocket {
5
5
  onGoingRequests;
6
6
  timeout;
7
7
  receiveCallbacks;
8
+ websocketUrl = "";
8
9
  openCallback;
9
10
  /* ------ PUBLIC ------ */
10
11
  /**
@@ -23,6 +24,7 @@ export class KoppeliaWebsocket {
23
24
  this.onGoingRequests = [];
24
25
  this.timeout = timeout;
25
26
  this.receiveCallbacks = [];
27
+ this.websocketUrl = websocketUrl;
26
28
  }
27
29
  /**
28
30
  * Send a new request: Add a request Id to the request and add it to the ongoing requests
@@ -115,7 +117,7 @@ export class KoppeliaWebsocket {
115
117
  // handle connection close (if an error occure)
116
118
  this.socket.onclose = (event) => {
117
119
  console.log(`Connection closed ${event.reason}, code=${event.code}, retry onnection ...`);
118
- setTimeout(this._connectWebsocket, 1000);
120
+ setTimeout(() => { this._connectWebsocket(this.websocketUrl); }, 1000);
119
121
  };
120
122
  }
121
123
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo2555/koppeliajs",
3
- "version": "0.0.102",
3
+ "version": "0.0.103",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",