You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried multiple versions of Node on Mac and I keep getting BufferShortageError.
This occurs during benchmarking with buffers of around 5kb. This doesn't happen on Linux.
node tests/benchmarks
/Users/frederic/node/Kalm/node_modules/msgpack-lite/lib/read-format.js:74
if (end > buffer.length) throw new BufferShortageError();
The text was updated successfully, but these errors were encountered:
The error happens when the app does not give enough length of Buffer to msgpack.decode().
A valid msgpack message may be divided into multiple chunks when sending through a network stream.
/** * Handler for receiving data through the listener * @private * @method handleRequest * @memberof Client * @param {Buffer} evt The data received */handleRequest(evt){varraw=encoders.resolve(this.options.encoder).decode(evt);if(raw&&raw.length){if(this.channels.hasOwnProperty(raw[0])){this.channels[raw[0]].handleData(raw[1]);}}}
I have not dived into the code of Kalm, however, I guess the OS X may divide the receiving data for 8192 bytes chunk each.
Use the Stream model or the Event model of the msgpack-lite module.
Those could manage the multiple chunks divided.
I've tried multiple versions of Node on Mac and I keep getting BufferShortageError.
This occurs during benchmarking with buffers of around 5kb. This doesn't happen on Linux.
You can get the code here: https://github.com/fed135/Kalm/tree/master/tests/benchmarks
(You can change the duration of the tests in /tests/settings.js)
The text was updated successfully, but these errors were encountered: