diff --git a/src/ic/ic-data-data-manager.js b/src/ic/ic-data-data-manager.js index 99e37ae..5aebae9 100644 --- a/src/ic/ic-data-data-manager.js +++ b/src/ic/ic-data-data-manager.js @@ -26,19 +26,19 @@ class IcDataDataManager { this._sockets = {}; } - open(endpoint, identifier) { + open(host, identifier) { // pass signals to onOpen callback if (this._sockets[identifier] != null) return; // already open? - this._sockets[identifier] = new WebsocketAPI(endpoint, { onOpen: (event) => this.onOpen(event, identifier, true), onClose: (event) => this.onClose(event, identifier), onMessage: (event) => this.onMessage(event, identifier) }); + this._sockets[identifier] = new WebsocketAPI(host, { onOpen: (event) => this.onOpen(event, identifier, true), onClose: (event) => this.onClose(event, identifier), onMessage: (event) => this.onMessage(event, identifier) }); } - update(endpoint, identifier) { + update(host, identifier) { if (this._sockets[identifier] != null) { - if (this._sockets[identifier].endpoint !== endpoint) { + if (this._sockets[identifier].host !== host) { this._sockets[identifier].close(); - this._sockets[identifier] = new WebsocketAPI(endpoint, { onOpen: (event) => this.onOpen(event, identifier, false), onClose: (event) => this.onClose(event, identifier), onMessage: (event) => this.onMessage(event, identifier), onError: (error) => this.onError(error, identifier) }); + this._sockets[identifier] = new WebsocketAPI(host, { onOpen: (event) => this.onOpen(event, identifier, false), onClose: (event) => this.onClose(event, identifier), onMessage: (event) => this.onMessage(event, identifier), onError: (error) => this.onError(error, identifier) }); } } }