Skip to content

Commit

Permalink
fixup! src: improve StreamBase read throughput
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Oct 21, 2018
1 parent 744d88c commit 6023661
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions benchmark/net/tcp-raw-s2c.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ function main({ dur, len, type }) {

connectReq.oncomplete = function() {
var bytes = 0;
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();
Expand Down

0 comments on commit 6023661

Please sign in to comment.