X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fxynt-http-streaming.js;h=2c43619e3658b4875e3bf9c59fb74309e62ed41a;hb=24ed800c2ca5855886af42f6f8ac4681a0089ee6;hp=0cbf36b7852cca1a363707801e531af73120a1c9;hpb=a9b42c350cd1a881b72aa6d1983a9d5600a2c6df;p=brisk.git diff --git a/web/xynt-http-streaming.js b/web/xynt-http-streaming.js index 0cbf36b..2c43619 100644 --- a/web/xynt-http-streaming.js +++ b/web/xynt-http-streaming.js @@ -37,11 +37,13 @@ http_streaming.prototype = { keepalive_old: -1, keepalive_new: -1, keepalives_equal: 0, - keepalives_eq_max: 6, + keepalives_eq_max: 3, /* NOTE: right watch_timeout value to 100, for devel reasons use 1000 or more */ - watchdog_timeout: 200, + // FIXME watchdog_timeout: 200, + /* restart after 200 * 20 * 3 millisec if server ping is missing => 12secs */ + watchdog_timeout: 300, watchdog_ct: 0, - watchdog_checktm: 20, + watchdog_checktm: 14, watchable: false, restart_n: 0, comm_match: /_*@BEGIN@(.*?)@END@/g, @@ -72,7 +74,7 @@ http_streaming.prototype = { // this.ifra.src = this.page; this.watchdog_ct = 0; if (!this.the_end) { - this.watchdog_hdl = setTimeout(function(obj) { obj.log("tout1"); obj.watchdog(); }, 0, this); + this.watchdog_hdl = setTimeout(function(obj) { obj.log("tout1"); obj.watchdog(); }, this.watchdog_timeout, this); } }, @@ -100,28 +102,29 @@ http_streaming.prototype = { // WATCHDOGING THE CONNECTION this.log("hs::watchdog: start, cur equal times: "+this.keepalives_equal); - if ( (this.watchdog_ct % this.watchdog_checktm) == 0 || !this.watchable) { - if (!this.watchable) { - do { - try{ - if (typeof(this.ifra.contentWindow.http_streaming) == 'undefined') - break; - } - catch(b) { - break; - } + if (!this.watchable) { + do { + try{ + if (typeof(this.ifra.contentWindow.http_streaming) == 'undefined') + break; + } + catch(b) { + break; + } - /* - on IE7 the the window frame scope is cleaned after the href is set, so we wait - for a well know variable value before assign this object value to it (OO is a passion) - */ - if (this.ifra.contentWindow.http_streaming == "ready") { - this.ifra.contentWindow.http_streaming = this; - this.watchable = true; - this.log("hs::watchdog: watchable = yes"); - } - } while (false); - } + /* + on IE7 the the window frame scope is cleaned after the href is set, so we wait + for a well know variable value before assign this object value to it (OO is a passion) + */ + if (this.ifra.contentWindow.http_streaming == "ready") { + this.ifra.contentWindow.http_streaming = this; + this.watchable = true; + this.watchdog_ct = 0; + this.log("hs::watchdog: watchable = yes"); + } + } while (false); + } + if ( (this.watchdog_ct % this.watchdog_checktm) == 0) { this.log("hs::watchdog: this.keepalive_old: "+this.keepalive_old+" this.keepalive_new: "+this.keepalive_new); if (this.keepalive_old == this.keepalive_new) { this.keepalives_equal++;