//*************************************************************// //some extra stuff for Websockets PoC //by: André Mussche, andre.mussche@gmail.com function WebSocketsWrapper(url, aWebSocketClientChannel) { this.updating = false; this.urlCall = url; this.WebSocketClientChannel = aWebSocketClientChannel; }; WebSocketsWrapper.prototype.post = function post(passData, isBinary, onSuccessFunction, onErrorFunction) { //if (this.updating) { // return false; //}; this.WS = this.WS || null; if (this.WS) { if (this.updating) { return false; } if (this.WS.readyState == 2 || //CLOSING this.WS.readyState == 3) //CLOSED this.WS = null; }; var parser = new BinaryParser(); //check websocket support if ("WebSocket" in window) { if (isBinary == true) { //add messagenr to end var sMsgNr = 'WSNR' + parser.encodeInt(12345, 32, false); passData = passData + sMsgNr; var len = passData.length; var data = new Uint8Array(len); for (var i=0; i