benchmark,windows: TCP.readStart() meaningful only after completion
fixes #11972 PR-URL: https://github.com/nodejs/node/pull/12258 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
ea44b8b283
commit
fbe946bb63
@ -97,8 +97,6 @@ function client() {
|
|||||||
if (err)
|
if (err)
|
||||||
fail(err, 'connect');
|
fail(err, 'connect');
|
||||||
|
|
||||||
clientHandle.readStart();
|
|
||||||
|
|
||||||
clientHandle.onread = function(nread, buffer) {
|
clientHandle.onread = function(nread, buffer) {
|
||||||
if (nread < 0)
|
if (nread < 0)
|
||||||
fail(nread, 'read');
|
fail(nread, 'read');
|
||||||
@ -112,6 +110,8 @@ function client() {
|
|||||||
|
|
||||||
bench.start();
|
bench.start();
|
||||||
|
|
||||||
|
clientHandle.readStart();
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
// multiply by 2 since we're sending it first one way
|
// multiply by 2 since we're sending it first one way
|
||||||
// then then back again.
|
// then then back again.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user