From 99bf915a9739a7d62f219934e8f227d65f36b3c6 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Fri, 14 Sep 2012 16:35:44 -0500 Subject: [PATCH] tcp-client.js: after read, try read again. After a read completes it's possible more data is pending so issue an immediate read again to pick this up quickly. --- include/chrome-app/tcp-client.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/chrome-app/tcp-client.js b/include/chrome-app/tcp-client.js index fc0777b..b8c125f 100644 --- a/include/chrome-app/tcp-client.js +++ b/include/chrome-app/tcp-client.js @@ -249,6 +249,9 @@ Author: Boris Smus (smus@chromium.org) this.callbacks.recvString(str); }.bind(this)); } + + // Trigger another read right away + setTimeout(this._periodicallyRead.bind(this), 0); } };