projects
/
xynt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
console argument passed to http_streaming constructor
[xynt.git]
/
web
/
xynt
/
xynt-http-streaming.js
diff --git
a/web/xynt/xynt-http-streaming.js
b/web/xynt/xynt-http-streaming.js
index
cd31ead
..
cb914e0
100644
(file)
--- a/
web/xynt/xynt-http-streaming.js
+++ b/
web/xynt/xynt-http-streaming.js
@@
-1,5
+1,6
@@
-function http_streaming(doc)
+function http_streaming(doc
, cons
)
{
{
+ this.console = cons;
this.doc = doc;
this.keepalive_old = -1;
this.keepalive_new = -1;
this.doc = doc;
this.keepalive_old = -1;
this.keepalive_new = -1;
@@
-14,20
+15,24
@@
function http_streaming(doc)
}
http_streaming.prototype = {
}
http_streaming.prototype = {
+ console: null,
doc: null,
ifra: null,
keepalive_old: -1,
keepalive_new: -1,
keepalives_equal: 0,
keepalives_eq_max: 6,
doc: null,
ifra: null,
keepalive_old: -1,
keepalive_new: -1,
keepalives_equal: 0,
keepalives_eq_max: 6,
+ watchdog_timeout: 2000,
start: function(page) {
start: function(page) {
+ this.log("http_streaming:start");
this.ifra.contentWindow.location.href = page;
this.ifra.contentWindow.location.href = page;
+ setTimeout(function(obj) { obj.watchdog(); }, this.watchdog_timeout, this);
},
watchdog: function () {
/* +this.keepalives_equal */
},
watchdog: function () {
/* +this.keepalives_equal */
-
console.log("watchdog
");
+
this.log("hs::watchdog: start
");
if (this.keepalive_old == this.keepalive_new) {
this.keepalives_equal++;
}
if (this.keepalive_old == this.keepalive_new) {
this.keepalives_equal++;
}
@@
-36,15
+41,20
@@
http_streaming.prototype = {
}
if (this.keepalives_equal > this.keepalives_eq_max) {
}
if (this.keepalives_equal > this.keepalives_eq_max) {
-
console.log("
MAX ACHIEVED "+this.keepalives_equal);
+
this.log("hs::watchdog:
MAX ACHIEVED "+this.keepalives_equal);
}
else {
}
else {
- setTimeout(function(obj) { obj.watchdog() },
2000
, this);
+ setTimeout(function(obj) { obj.watchdog() },
this.watchdog_timeout
, this);
}
},
keepalive: function () {
this.keepalive_new++;
}
},
keepalive: function () {
this.keepalive_new++;
+ },
+
+ log: function (s) {
+ if (this.console != null) {
+ return (this.console.log(s));
+ }
}
}
-
}
\ No newline at end of file
}
\ No newline at end of file