Closed Erchoc closed 6 years ago
Socket.prototype.deSerialize = function(chunk) { const chunks = []; let bl = HEADER_LENGTH;
if (!chunks.length) { bl += chunk.readInt32BE(12); } chunks.push(chunk); const heap = Buffer.concat(chunks);
if (heap.length === bl) { decode(heap, (err, result) => { this.transmiting = false; this.heartBeatLock = false;
err ? this.reject(err) : this.resolve(result); this.resolve = null; this.reject = null; this.cb(null, true); });
} };
Fixed with a20cd528a07b32195233ac109d9d0d139c139915
Socket.prototype.deSerialize = function(chunk) { const chunks = []; let bl = HEADER_LENGTH;
if (!chunks.length) { bl += chunk.readInt32BE(12); } chunks.push(chunk); const heap = Buffer.concat(chunks);
if (heap.length === bl) { decode(heap, (err, result) => { this.transmiting = false; this.heartBeatLock = false;
} };