1 function http_streaming(doc, cons)
5 this.keepalive_old = -1;
6 this.keepalive_new = -1;
7 this.keepalives_equal = 0;
8 this.ifra = doc.createElement("iframe");
9 this.ifra.style.visibility = "hidden";
10 doc.body.appendChild(this.ifra);
11 // this.ifra.contentWindow.onload = function () {
12 // this.ifra.contentWindow.location.href = 'winstream_rdxxx.php';
17 http_streaming.prototype = {
25 watchdog_timeout: 2000,
27 start: function(page) {
28 this.log("http_streaming:start");
29 this.ifra.contentWindow.location.href = page;
30 setTimeout(function(obj) { obj.watchdog(); }, this.watchdog_timeout, this);
33 watchdog: function () {
34 /* +this.keepalives_equal */
35 this.log("hs::watchdog: start");
36 if (this.keepalive_old == this.keepalive_new) {
37 this.keepalives_equal++;
40 this.keepalives_equal = 0;
43 if (this.keepalives_equal > this.keepalives_eq_max) {
44 this.log("hs::watchdog: MAX ACHIEVED "+this.keepalives_equal);
47 setTimeout(function(obj) { obj.watchdog() }, this.watchdog_timeout, this);
51 keepalive: function () {
56 if (this.console != null) {
57 return (this.console.log(s));