node-query/node_modules/mysql2/benchmarks/ping-pong-client.js

19 lines
274 B
JavaScript
Raw Normal View History

var net = require('net');
var count = 0;
var byte = new Buffer([0x33]);
function pong()
{
count++;
this.write(byte);
}
var c = net.connect(3334);
c.setNoDelay(true);
c.ondata = pong;
pong.apply(c);
setInterval(function() {
console.log(count);
count = 0;
}, 1000);