Browse Source

fixed issue where connections total was not clearing when reducing from double to single figures.. deps..

master
Lloyd Brookes 11 years ago
parent
commit
5bb9649302
  1. 2
      package.json
  2. 8
      ws.js

2
package.json

@ -10,7 +10,7 @@
"dependencies": { "dependencies": {
"connect": "~2.13.0", "connect": "~2.13.0",
"nature": "~0.3.0", "nature": "~0.3.0",
"more-console": "~0.1.0",
"console-dope": "~0.1.0",
"wodge": "~0.2.0" "wodge": "~0.2.0"
} }
} }

8
ws.js

@ -1,6 +1,6 @@
#!/usr/bin/env node #!/usr/bin/env node
"use strict"; "use strict";
require("more-console");
require("console-dope");
var connect = require("connect"), var connect = require("connect"),
http = require("http"), http = require("http"),
util = require("util"), util = require("util"),
@ -56,7 +56,7 @@ if (argv.help){
}; };
process.on("SIGINT", function(){ process.on("SIGINT", function(){
console.show();
console.showCursor();
console.log(); console.log();
process.exit(0); process.exit(0);
}); });
@ -115,7 +115,7 @@ if (argv.help){
in stats mode, monitor connections and bytes transferred in stats mode, monitor connections and bytes transferred
*/ */
if (!argv["log-format"]){ if (!argv["log-format"]){
console.hide();
console.hideCursor();
console.log("%u{Requests} %u{Data} %u{Connections}"); console.log("%u{Requests} %u{Data} %u{Connections}");
server.on("connection", function(socket){ server.on("connection", function(socket){
var oldWrite = socket.write; var oldWrite = socket.write;
@ -129,7 +129,7 @@ if (argv.help){
}; };
console.column(24).write(++total.connections); console.column(24).write(++total.connections);
socket.on("close", function(){ socket.on("close", function(){
console.column(24).write(--total.connections);
console.column(24).write((--total.connections + " ").slice(0,12));
}); });
}); });
} }

Loading…
Cancel
Save