Skip to content

Commit bc654be

Browse files
author
deadBranch
committed
packet batching
1 parent 49b60bf commit bc654be

38 files changed

+1417
-1672
lines changed

callgrind.out.3060

+1,254
Large diffs are not rendered by default.

index.js

+29-13
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,52 @@ var twc = require('./tokenwizard.js');
22

33
twc.init(32);
44
twc.connect();
5+
/*
56
twc.invalidate("xya0baHvB2Nwx44xSWrkWtmyompvGGnlgY4Ken", function (err) {
67
78
});
8-
twc.get_token("xya0baHvB2Nwx44xSWrkWtmyompvGGnlgY4Ken", function (err, data) {
9+
twc.get_token("hn6QaaoPxoqvhD6VSvkP0SoYv7xMjCEemJh1JT", function (err, data) {
910
if(!err)
1011
console.log(data.toString('ascii'));
1112
});
12-
13+
*/
1314
var i = 1;
1415
var foo;
1516

16-
twc.gen_token(Buffer.from("12345", 'ascii'), 1000, function (err, data) {
17-
if(!err)
18-
{
19-
console.log(data.toString('ascii'));
20-
++i;
21-
}
22-
else
23-
console.log("Threre is no token!");
24-
});
17+
foo = function () {
18+
/*
19+
twc.get_token("4ytyba4fh2gBVgRT0FF2MbflUoAtKixsBrM3s0", function (err, data) {
20+
if(!err)
21+
++i;//console.log(data.toString('ascii'));
22+
});
23+
/**/
2524

25+
twc.gen_token(Buffer.from("12345", 'ascii'), 5, function (err, data) {
26+
if(!err)
27+
{
28+
//console.log(data.toString('ascii'));
29+
++i;
30+
}
31+
else
32+
console.log("Threre is no token!");
33+
});
34+
/**/
35+
36+
setImmediate(foo);
37+
};
38+
39+
foo();
2640
/*
2741
*/
2842
var benchmark;
43+
44+
2945
benchmark = function() {
3046
console.log(i);
31-
i = 0;
47+
//i = 0;
3248
setTimeout(benchmark, 1000);
3349
};
34-
//benchmark();
50+
benchmark();
3551

3652
function randomInt (low, high) {
3753
return Math.floor(Math.random() * (high - low) + low);

node_modules/.bin/uuid

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/chrome2calltree/package.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/dashdash/etc/dashdash.bash_completion.in

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/dashdash/package.json

+14-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/fstream/node_modules/graceful-fs/package.json

+11-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/fstream/node_modules/graceful-fs/polyfills.js

+10-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/node-uuid/.npmignore

-4
This file was deleted.

node_modules/node-uuid/LICENSE.md

-21
This file was deleted.

0 commit comments

Comments
 (0)