diff --git a/services/ndd_service.js b/services/ndd_service.js index 5dd54d95..63b61dbc 100644 --- a/services/ndd_service.js +++ b/services/ndd_service.js @@ -95,16 +95,22 @@ class NddService { const pipeName = `node-ndb.${process.pid}.sock`; this._pipe = path.join(pipePrefix, pipeName); const server = net.createServer(socket => { + let chunks = []; socket.on('data', async d => { - const runSession = await this._startSession(JSON.parse(d), frontend); + chunks.push(d) + }); + socket.on('end', async () => { + let data = Buffer.concat(chunks); + const runSession = await this._startSession(JSON.parse(data), frontend); socket.write('run'); runSession(); - }); + }) socket.on('error', e => caughtErrorDebug(e)); }).listen(this._pipe); server.unref(); } + dispose() { process.disconnect(); }