This repository has been archived on 2018-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
node-task/node_modules/mysql2/benchmarks/ping-pong-client.js

19 lines
274 B
JavaScript

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);