diff options
author | Luciano Iam <lucianito@gmail.com> | 2020-04-11 17:45:52 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-04-11 22:30:41 +0200 |
commit | 02cdd5b52d208eaf89ae5a82937acea413cbac3d (patch) | |
tree | 6c52d347e6bf69770db98867f3dbd4075edf6cf0 | |
parent | ece0bcde8b15016136c00e9cd7c2ec6f65487f0b (diff) |
WebSockets: re-add close callback in channel.js
-rw-r--r-- | share/web_surfaces/shared/channel.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/share/web_surfaces/shared/channel.js b/share/web_surfaces/shared/channel.js index 21c23b6cac..8f4a178a7c 100644 --- a/share/web_surfaces/shared/channel.js +++ b/share/web_surfaces/shared/channel.js @@ -28,11 +28,16 @@ export class Channel { open () { return new Promise((resolve, reject) => { this.socket = new WebSocket(`ws://${this.host}`); + this.socket.onclose = () => this.closeCallback(); this.socket.onerror = (error) => this.errorCallback(error); this.socket.onmessage = (event) => this._onMessage(event); this.socket.onopen = resolve; }); } + + closeCallback () { + // empty + } errorCallback (error) { // empty |