The problem that I'm facing currently is the server continuously is pushing binary data through TCP port, I'm able to read these data but the problem is when the data is too large my app is crashing because can't close properly the object. The application is built in node JS and I tried to use json-stream but without success.
EXAMPLE:
var client = new net.Socket();
client.connect(PORT, HOST, function() {
console.log('CONNECTED TO: ' + HOST + ':' + PORT);
}
client.on('data', function(data) {
var readyToExplore = JSON.parse(data.toString());
console.log(readyToExplore);
}
The app will crash if try to parse to JSON but if left as a data.toString() then it's not a problem.