WebSockets: re-add close callback in channel.js
This commit is contained in:
parent
ece0bcde8b
commit
02cdd5b52d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user