else
this.name = "WebSocket";
this.ctx_new = "";
- this.out_queue = [];
var self = this;
this.doc = doc;
name: null,
xynt_streaming: "ready",
ws: null,
- out_queue: null,
stopped: true,
failed: false,
},
flush_out_queue: function() {
- var l_out = this.out_queue.length;
+ var l_out = this.xynt_streaming.out_queue.length;
+
if (l_out == 0)
return;
+ console.log('flush_out_queue: ' + l_out);
for (var i = 0 ; i < l_out ; i++) {
if (this.ws.readyState != 1) {
break;
}
- var item = this.out_queue.shift();
+ var item = this.xynt_streaming.out_queue.shift();
var sent = true;
try {
this.ws.send(item);
}
catch (ex) {
- this.out_queue.unshift(item);
+ this.xynt_streaming.out_queue.unshift(item);
break;
}
}
}
catch (ex) {
console.log(' ... catched exception');
- this.flush_out.push(msg);
+ this.xynt_streaming.out_queue.push(msg);
}
}
else {
- console.log('ws not ready: push into flush_out');
- this.flush_out.push(msg);
+ console.log('ws not ready: push into out_queue');
+ this.xynt_streaming.out_queue.push(msg);
}
},
}
}
-function xynt_streaming(win, transp_type, transp_port, transp_fback, console, gst, from, cookiename, sess, sandbox, page, cmdproc)
+function xynt_streaming(win, transp_type, transp_port, transp_fback, console, gst, from, cookiename, sess, sandbox, page, page_id, cmdproc)
{
this.win = win;
this.transp_type = transp_type;
this.sess = sess;
this.sandbox = sandbox;
this.page = page;
+ this.page_id = page_id;
this.cmdproc = cmdproc;
// this.cmdproc = function(com){/* console.log("COM: "+com); */ eval(com);}
this.doc = win.document;
this.keepalive_old = -1;
this.keepalive_new = -1;
+ this.out_queue = [];
this.mon_errtime = this.keepalives_eq_max * this.watchdog_checktm * this.watchdog_timeout;
this.mon_wrntime = this.mon_errtime / 2;
sess: null,
sandbox: null,
page: null,
+ page_id: null,
cmdproc: null,
start_time: 0,
comm_match: /_*@BEGIN@(.*?)@END@/g,
comm_clean: /_*@BEGIN@(.*?)@END@/,
stream: "",
+ out_queue: null,
the_end: false,
mon_time: -1,
}
// stat, subst, this.gst.st
- page = url_append_args(page, "sess", this.sess, "stat", stat, "subst", subst, "step", this.gst.st, "from", this.from);
+ page = url_append_args(page, "sess", this.sess, "page_id", this.page_id, "stat", stat, "subst", subst, "step", this.gst.st, "from", this.from);
// this.log("the page:");
// this.log(page);