Close sockets 'beforeunload'

This commit is contained in:
xdrm-brackets 2017-12-04 19:44:30 +01:00
parent c02253dc11
commit e0debfed54
1 changed files with 7 additions and 0 deletions

View File

@ -77,3 +77,10 @@ window.wsc_chat = window.wsc.channel('chat').listen(function(msg, err){
}).send({name: window._SERVER.session.name}); }).send({name: window._SERVER.session.name});
/* (4) Clean sockets before page quit
---------------------------------------------------------*/
window.onbeforeunload = function() {
window.wdc_chat.ws.close();
window.wdc_connect.ws.close();
};