When we get a burst of data that fills up the buffer, we don't want to
delay 500 msecs for the buffer to refill. So let the caller force a
fresh pull of data when it knows it is expecting more.
*/
TcpClient.prototype._onConnectComplete = function(resultCode) {
// Start polling for reads.
- setInterval(this._periodicallyRead.bind(this), 500);
+ setInterval(this.poll.bind(this), 500);
if (this.callbacks.connect) {
log('connect complete');
*
* @see http://developer.chrome.com/apps/socket.html#method-read
*/
- TcpClient.prototype._periodicallyRead = function() {
+ TcpClient.prototype.poll = function() {
socket.read(this.socketId, null, this._onDataRead.bind(this));
};
TcpClientSender.prototype.send = function(data, cb) {
this.tcpclient.sendMessage(data, cb);
}
+TcpClientSender.prototype.poll = function() {
+ this.tcpclient.poll();
+}
function tramp_mpc_recv(data) {
mpc.recv(data);