diff --git a/index.js b/index.js index d922764..07bcfcd 100644 --- a/index.js +++ b/index.js @@ -815,16 +815,17 @@ Socket.prototype._read = function (bufferSize) { Socket.prototype._onReceive = function (data) { var buffer = Buffer.from(data) var offset = this.bytesRead + console.log("onReceive got "+buffer.length+" bytes: "+buffer.slice(0,50).toString('hex')+"...") this.bytesRead += buffer.length - this._unrefTimer() + //this._unrefTimer() if (this.ondata) { console.error('socket.ondata = func is non-standard, use socket.on(\'data\', func)') this.ondata(buffer, offset, this.bytesRead) } if (!this.push(buffer)) { // if returns false, then apply backpressure - chrome.sockets.tcp.setPaused(this.id, true) + // chrome.sockets.tcp.setPaused(this.id, true) // onReceive will be called again with this data } }