From c5b2fd40459b3ef6e7993a5048d4445e84b219c0 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Tue, 20 Aug 2013 14:10:26 +0200 Subject: [PATCH] fixed fallback error --- web/xynt-streaming.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/xynt-streaming.js b/web/xynt-streaming.js index 1751ca0..507490f 100644 --- a/web/xynt-streaming.js +++ b/web/xynt-streaming.js @@ -12,6 +12,7 @@ function transport_ws(doc, xynt_streaming, page) this.failed = false; this.xynt_streaming = xynt_streaming; try { +this.xynt_streaming.log("PAGE: "+page); this.ws = new WebSocket(page); this.ws.onopen = function () { self.xynt_streaming.log("onopen"); @@ -27,6 +28,9 @@ function transport_ws(doc, xynt_streaming, page) self.ctx_new += msg.data; }; this.ws.onclose = function (msg) { + this.onopen = null; + this.onclose = null; + this.onerror = null; self.xynt_streaming.log("onclose"+self.init_steps); if (self.init_steps == 0) self.ws_cb("error"); @@ -35,6 +39,9 @@ function transport_ws(doc, xynt_streaming, page) }; this.ws.onerror = function () { // on error + this.onopen = null; + this.onclose = null; + this.onerror = null; self.xynt_streaming.log("onerror"); self.ws_cb("error"); }; @@ -74,6 +81,7 @@ transport_ws.prototype = { if (from == "error") { if (this.xynt_streaming != "ready") { if (this.xynt_streaming.transp_fback > 0) { +this.xynt_streaming.log("DEC: "+this.xynt_streaming.transp_fback); this.xynt_streaming.transp_fback--; this.stopped = true; this.xynt_streaming.reload(); @@ -87,6 +95,7 @@ transport_ws.prototype = { ws_abort: function() { if (this.ws != null) { +this.xynt_streaming.log("WSCLOSE"); this.ws.close(); } }, -- 2.17.1