diff options
Diffstat (limited to 'benchmark/net/tcp-raw-c2s.js')
-rw-r--r-- | benchmark/net/tcp-raw-c2s.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/benchmark/net/tcp-raw-c2s.js b/benchmark/net/tcp-raw-c2s.js index 1f10ae7c83..116cf57a23 100644 --- a/benchmark/net/tcp-raw-c2s.js +++ b/benchmark/net/tcp-raw-c2s.js @@ -46,15 +46,15 @@ function main({ dur, len, type }) { process.exit(0); }, dur * 1000); - clientHandle.onread = function(nread, buffer) { + clientHandle.onread = function(buffer) { // we're not expecting to ever get an EOF from the client. // just lots of data forever. - if (nread < 0) - fail(nread, 'read'); + if (!buffer) + fail('read'); // don't slice the buffer. the point of this is to isolate, not // simulate real traffic. - bytes += buffer.length; + bytes += buffer.byteLength; }; clientHandle.readStart(); |