From 800936ab0897812d5e8770e033e10545d3125df8 Mon Sep 17 00:00:00 2001 From: Duknam Yoo Date: Thu, 9 Nov 2017 14:33:43 +0900 Subject: [PATCH] Fix ipcBuffer being shared with all sockets --- dao/socketServer.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dao/socketServer.js b/dao/socketServer.js index 4fd99be..7691882 100644 --- a/dao/socketServer.js +++ b/dao/socketServer.js @@ -165,18 +165,18 @@ function gotData(socket,data,UDPSocket){ return; } - if(!this.ipcBuffer){ - this.ipcBuffer=''; + if(!sock.ipcBuffer){ + sock.ipcBuffer=''; } - data=(this.ipcBuffer+=data); + data=(sock.ipcBuffer+=data); if(data.slice(-1)!=eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1){ this.log('Messages are large, You may want to consider smaller messages.'); return; } - this.ipcBuffer=''; + sock.ipcBuffer=''; data=eventParser.parse(data);