Merge pull request #132 from yoo2001818/master
Fix ipcBuffer being shared with all connected sockets
This commit is contained in:
commit
076053ead7
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue