Close remote app on error or disconnect

This commit is contained in:
Rafostar
2020-12-15 19:03:58 +01:00
parent dde35270ff
commit a1e95dc012
2 changed files with 16 additions and 1 deletions

View File

@@ -57,7 +57,7 @@ class ClapperWebClient extends Soup.Session
}
if(!connection)
return;
return this.passMsgData('close');
connection.connect('message', this._onWsMessage.bind(this));
connection.connect('closed', this._onWsClosed.bind(this));
@@ -78,5 +78,7 @@ class ClapperWebClient extends Soup.Session
_onWsClosed(connection)
{
debug('closed WebSocket connection');
this.passMsgData('close');
}
});