From ef1afdc4a43ea76364d2db00e1a22f0d072b4e0e Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Thu, 6 Apr 2017 08:42:46 -0400 Subject: [PATCH] benchmark,windows: TCP.readStart() meaningful only after completion fixes #11972 PR-URL: https://github.com/nodejs/node/pull/12258 Reviewed-By: Matteo Collina Reviewed-By: James M Snell --- benchmark/net/tcp-raw-pipe.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmark/net/tcp-raw-pipe.js b/benchmark/net/tcp-raw-pipe.js index fb8da5ea41faf3..b6a61e49dc9748 100644 --- a/benchmark/net/tcp-raw-pipe.js +++ b/benchmark/net/tcp-raw-pipe.js @@ -97,8 +97,6 @@ function client() { if (err) fail(err, 'connect'); - clientHandle.readStart(); - clientHandle.onread = function(nread, buffer) { if (nread < 0) fail(nread, 'read'); @@ -112,6 +110,8 @@ function client() { bench.start(); + clientHandle.readStart(); + setTimeout(function() { // multiply by 2 since we're sending it first one way // then then back again.