Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Commit

Permalink
catch remaining individual socket errors
Browse files Browse the repository at this point in the history
  • Loading branch information
askmike committed Aug 20, 2018
1 parent 6aef221 commit de8cfa7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ wss.on('connection', ws => {
ws.isAlive = true;
});
ws.ping(_.noop);
ws.on('error', e => {
console.error(new Date, '[WS] connection error:', e);
});
});


setInterval(() => {
wss.clients.forEach(ws => {
if(!ws.isAlive) {
Expand Down

0 comments on commit de8cfa7

Please sign in to comment.