X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fxynt-streaming.js;h=1751ca0ef9a782f0740e181cec8ff8b79329f72a;hb=809cb505ca6a85558d88140f7c9dbadbf82b080e;hp=f80e8e82d4ab93d84c150cc242e6b4ecd2401b8a;hpb=ddd822f1dca51731cc9fc8199db3f1cc527fb01a;p=brisk.git diff --git a/web/xynt-streaming.js b/web/xynt-streaming.js index f80e8e8..1751ca0 100644 --- a/web/xynt-streaming.js +++ b/web/xynt-streaming.js @@ -18,6 +18,7 @@ function transport_ws(doc, xynt_streaming, page) if (this.readyState == 1) { // connected self.ws_cb("open"); + self.init_steps = 1; } }; this.ws.onmessage = function (msg) { @@ -26,8 +27,11 @@ function transport_ws(doc, xynt_streaming, page) self.ctx_new += msg.data; }; this.ws.onclose = function (msg) { - self.xynt_streaming.log("onclose"); - self.ws_cb("close"); + self.xynt_streaming.log("onclose"+self.init_steps); + if (self.init_steps == 0) + self.ws_cb("error"); + else + self.ws_cb("close"); }; this.ws.onerror = function () { // on error @@ -49,6 +53,8 @@ transport_ws.prototype = { stopped: true, failed: false, + init_steps: 0, + ctx_old: "", ctx_old_len: 0, ctx_new: "",