Meteor failure switching to smartpoll mode?

23 views
Skip to first unread message

Ramon Poca

unread,
Dec 29, 2010, 6:59:24 AM12/29/10
to meteorserver
Hi there,
We had a nasty bug where connections that timed out and defaulted to
smartpoll stopped working.
We've traced it and found that, when switching to "smartpoll" mode,
first the status is set to "1" in Meteor.js.

Then, if there is no messages, the server responds immediately with:

Meteor.clearpoll();

That causes Meteor to keep on the "1" status (connecting), but
Meteor.js:clearpoll() expects a status of 5 to set the timer again.
Thus, the timer is never set and Meteor keeps disconnected.

clearpoll: function() {
...
if (Meteor.status == 5) {
var x = parent.Meteor.pollfreq - (Meteor.time()-
Meteor.lastrequest);
if (x < 10) x = 10;
Meteor.log( '[Meteor.clearpoll] set timeout poll: ' + x );
setTimeout(Meteor.poll, x);
}

(One solution is to send a ping with the FooterTemplate for smartpoll,
but I'm not sure it's clean enough)
FooterTemplate Meteor.process(-1);\r\nMeteor.clearpoll();\r\n

Can somebody confirm that?
Reply all
Reply to author
Forward
0 new messages