diff --git a/lib/transport/binary/connection.js b/lib/transport/binary/connection.js index 86ea9493..87cf65bd 100644 --- a/lib/transport/binary/connection.js +++ b/lib/transport/binary/connection.js @@ -283,8 +283,11 @@ Connection.prototype.handleSocketData = function (data) { this.remaining = null; } else { - this.remaining = buffer.slice(offset); - } + var self = this; + setTimeout(function() { + self.handleSocketData(buffer.slice(offset)); + }); + } }; /** @@ -365,7 +368,7 @@ Connection.prototype.process = function (buffer, offset) { result = parsed[2]; this.emit('update-config', result); return offset; - }else if(status === OperationStatus.LIVE_RESULT){ + } else if (status === OperationStatus.LIVE_RESULT){ token = parsed[1]; operation = parsed[2]; result = parsed[3]; @@ -412,4 +415,4 @@ Connection.prototype.process = function (buffer, offset) { } } return offset; -}; +}; \ No newline at end of file