From c2c2c29ec525178ddbe8d58ad4f21d38274d8999 Mon Sep 17 00:00:00 2001 From: Lloyd Brookes Date: Thu, 13 Feb 2014 14:26:42 +0100 Subject: [PATCH] account for socket closures --- ws.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ws.js b/ws.js index 1356c5c..a688bb8 100755 --- a/ws.js +++ b/ws.js @@ -110,6 +110,9 @@ if (argv.help){ console.column(12).write((w.bytesToSize(total.bytes, 2) + " ").slice(0,12)); }; console.column(24).write(++total.connections); + socket.on("close", function(){ + console.column(24).write(--total.connections); + }); }); } }