michaelwittig / node-q

Q interfacing with Node.js
MIT License
52 stars 14 forks source link

handle chunk data packages #1

Closed michaelwittig closed 9 years ago

michaelwittig commented 9 years ago

Reported from Markus Sieber via personal-kdbplus@googlegroups.com

you assume that a whole message comes in one chunk in the data event "this.socket.on("data", function(buffer) {." unfortunately this is not always correct. Tcp can split the data and so the data callback might be triggered mutliple times for one k ipc message. You have to buffer the data and check the length.