Lines Matching refs:_sock

63         this._sock = null;              // Websock object
172 this._sock = new Websock();
173 this._sock.on('message', this._handle_message.bind(this));
174 this._sock.on('open', function () {
181 this._sock.on('close', function (e) {
201 this._sock.on('error', function (e) {
261 this._sock.send(arr);
267 this._sock.send_string("\xFA\x00" + String.fromCharCode(ver) + String.fromCharCode(op));
296 this._sock.send(arr);
301 this._sock.send(RFB.messages.clientCutText(text));
319 this._sock.open(uri, this._wsProtocols);
326 this._sock.init();
422 this._sock.close();
506 if (this._sock.rQlen() === 0) {
517 if (this._normal_msg() && this._sock.rQlen() > 0) {
539 this._sock.send(this._mouse_arr);
546 this._sock.send(RFB.messages.keyEvent(keysym, down));
572 this._sock.send(this._mouse_arr);
599 if (this._sock.rQlen() < 12) {
603 var sversion = this._sock.rQshiftStr(12).substr(4, 7);
632 this._sock.send_string(repeaterID);
642 this._sendTimer = setInterval(this._sock.flush.bind(this._sock), 50);
646 this._sock.send_string("RFB " + cversion + "\n");
653 var num_types = this._sock.rQshift8();
654 if (this._sock.rQwait("security type", num_types, 1)) { return false; }
657 var strlen = this._sock.rQshift32();
658 var reason = this._sock.rQshiftStr(strlen);
663 var types = this._sock.rQshiftBytes(num_types);
675 this._sock.send([this._rfb_auth_scheme]);
678 if (this._sock.rQwait("security scheme", 4)) { return false; }
679 this._rfb_auth_scheme = this._sock.rQshift32();
701 this._sock.send_string(xvp_auth_str);
715 if (this._sock.rQwait("auth challenge", 16)) { return false; }
717 var challenge = this._sock.rQshiftBytes(16);
719 this._sock.send(response);
731 var cap_code = this._sock.rQshift32();
732 var cap_vendor = this._sock.rQshiftStr(4);
733 var cap_signature = this._sock.rQshiftStr(8);
743 this._sock.send([0, 0, 0, 0]); // use NOTUNNEL
752 if (this._sock.rQwait("num tunnels", 4)) { return false; }
753 var numTunnels = this._sock.rQshift32();
754 …if (numTunnels > 0 && this._sock.rQwait("tunnel capabilities", 16 * numTunnels, 4)) { return false…
765 if (this._sock.rQwait("sub auth count", 4)) { return false; }
766 var subAuthCount = this._sock.rQshift32();
767 if (this._sock.rQwait("sub auth capabilities", 16 * subAuthCount, 4)) { return false; }
777 var capNum = this._sock.rQshift32();
778 var capabilities = this._sock.rQshiftStr(12);
784 this._sock.send([0, 0, 0, clientSupportedTypes[authType]]);
805 if (this._sock.rQwait("auth reason", 4)) { return false; }
806 var strlen = this._sock.rQshift32();
807 var reason = this._sock.rQshiftStr(strlen);
833 if (this._sock.rQwait('VNC auth response ', 4)) { return false; }
834 switch (this._sock.rQshift32()) {
840 var length = this._sock.rQshift32();
841 if (this._sock.rQwait("SecurityResult reason", length, 8)) { return false; }
842 var reason = this._sock.rQshiftStr(length);
854 if (this._sock.rQwait("server initialization", 24)) { return false; }
857 this._fb_width = this._sock.rQshift16();
858 this._fb_height = this._sock.rQshift16();
861 var bpp = this._sock.rQshift8();
862 var depth = this._sock.rQshift8();
863 var big_endian = this._sock.rQshift8();
864 var true_color = this._sock.rQshift8();
866 var red_max = this._sock.rQshift16();
867 var green_max = this._sock.rQshift16();
868 var blue_max = this._sock.rQshift16();
869 var red_shift = this._sock.rQshift8();
870 var green_shift = this._sock.rQshift8();
871 var blue_shift = this._sock.rQshift8();
872 this._sock.rQskipBytes(3); // padding
878 var name_length = this._sock.rQshift32();
879 if (this._sock.rQwait('server init name', name_length, 24)) { return false; }
880 this._fb_name = Util.decodeUTF8(this._sock.rQshiftStr(name_length));
883 …if (this._sock.rQwait('TightVNC extended server init header', 8, 24 + name_length)) { return false…
885 var numServerMessages = this._sock.rQshift16();
886 var numClientMessages = this._sock.rQshift16();
887 var numEncodings = this._sock.rQshift16();
888 this._sock.rQskipBytes(2); // padding
891 …if (this._sock.rQwait('TightVNC extended server init header', totalMessagesLength, 32 + name_lengt…
895 var srvMsg = this._sock.rQshiftStr(16);
899 var clientMsg = this._sock.rQshiftStr(16);
903 var encoding = this._sock.rQshiftStr(16);
963 this._sock.send(response);
989 this._sock.send([this._shared ? 1 : 0]); // ClientInitialisation
1000 this._sock.rQskip8(); // Padding
1002 var first_colour = this._sock.rQshift16();
1003 var num_colours = this._sock.rQshift16();
1004 if (this._sock.rQwait('SetColorMapEntries', num_colours * 6, 6)) { return false; }
1007 var red = parseInt(this._sock.rQshift16() / 256, 10);
1008 var green = parseInt(this._sock.rQshift16() / 256, 10);
1009 var blue = parseInt(this._sock.rQshift16() / 256, 10);
1020 if (this._sock.rQwait("ServerCutText header", 7, 1)) { return false; }
1021 this._sock.rQskipBytes(3); // Padding
1022 var length = this._sock.rQshift32();
1023 if (this._sock.rQwait("ServerCutText", length, 8)) { return false; }
1025 var text = this._sock.rQshiftStr(length);
1032 if (this._sock.rQwait("XVP version and message", 3, 1)) { return false; }
1033 this._sock.rQskip8(); // Padding
1034 var xvp_ver = this._sock.rQshift8();
1035 var xvp_msg = this._sock.rQshift8();
1060 msg_type = this._sock.rQshift8();
1067 … this._sock.send(RFB.messages.fbUpdateRequests(this._display.getCleanDirtyReset(),
1088 Util.Debug("sock.rQslice(0, 30): " + this._sock.rQslice(0, 30));
1098 if (this._sock.rQwait("FBU header", 3, 1)) { return false; }
1099 this._sock.rQskip8(); // Padding
1100 this._FBU.rects = this._sock.rQshift16();
1112 if (this._sock.rQwait("FBU", this._FBU.bytes)) { return false; }
1114 if (this._sock.rQwait("rect header", 12)) { return false; }
1117 var hdr = this._sock.rQshiftBytes(12);
1370 if (this._sock.rQwait("RAW", this._FBU.bytes)) { return false; }
1373 … Math.floor(this._sock.rQlen() / (this._FBU.width * this._fb_Bpp)));
1375 curr_height, this._sock.get_rQ(),
1376 this._sock.get_rQi());
1377 this._sock.rQskipBytes(this._FBU.width * curr_height * this._fb_Bpp);
1392 if (this._sock.rQwait("COPYRECT", 4)) { return false; }
1395 'old_x': this._sock.rQshift16(),
1396 'old_y': this._sock.rQshift16(),
1411 if (this._sock.rQwait("RRE", 4 + this._fb_Bpp)) { return false; }
1412 this._FBU.subrects = this._sock.rQshift32();
1413 color = this._sock.rQshiftBytes(this._fb_Bpp); // Background
1417 while (this._FBU.subrects > 0 && this._sock.rQlen() >= (this._fb_Bpp + 8)) {
1418 color = this._sock.rQshiftBytes(this._fb_Bpp);
1419 var x = this._sock.rQshift16();
1420 var y = this._sock.rQshift16();
1421 var width = this._sock.rQshift16();
1422 var height = this._sock.rQshift16();
1439 var rQ = this._sock.get_rQ();
1440 var rQi = this._sock.get_rQi();
1451 if (this._sock.rQwait("HEXTILE subencoding", this._FBU.bytes)) { return false; }
1479 … if (this._sock.rQwait("hextile subrects header", this._FBU.bytes)) { return false; }
1489 if (this._sock.rQwait("hextile", this._FBU.bytes)) { return false; }
1543 this._sock.set_rQi(rQi);
1576 if (this._sock.rQwait("TIGHT compression-control", this._FBU.bytes)) { return false; }
1649 var rQ = this._sock.get_rQ();
1650 var rQi = this._sock.get_rQi();
1657 if (this._sock.rQwait("TIGHT palette " + cmode, this._FBU.bytes)) { return false; }
1666 … clength = RFB.encodingHandlers.getTightCLength(this._sock.rQslice(3 + paletteSize,
1671 if (this._sock.rQwait("TIGHT " + cmode, this._FBU.bytes)) { return false; }
1674 this._sock.rQskipBytes(3);
1675 var palette = this._sock.rQshiftBytes(paletteSize);
1676 this._sock.rQskipBytes(clength[0]);
1679 data = this._sock.rQshiftBytes(clength[1]);
1681 data = decompress(this._sock.rQshiftBytes(clength[1]));
1706 clength = RFB.encodingHandlers.getTightCLength(this._sock.rQslice(1, 4));
1709 if (this._sock.rQwait("TIGHT " + cmode, this._FBU.bytes)) { return false; }
1712 this._sock.rQshiftBytes(1 + clength[0]);
1715 data = this._sock.rQshiftBytes(clength[1]);
1717 data = decompress(this._sock.rQshiftBytes(clength[1]));
1732 var ctl = this._sock.rQpeek8();
1770 if (this._sock.rQwait("TIGHT " + cmode, this._FBU.bytes)) { return false; }
1775 this._sock.rQskip8(); // shift off ctl
1776 var color = this._sock.rQshiftBytes(this._fb_depth);
1788 clength = RFB.encodingHandlers.getTightCLength(this._sock.rQslice(1, 4));
1790 if (this._sock.rQwait("TIGHT " + cmode, this._FBU.bytes)) { return false; }
1793 this._sock.rQskipBytes(1 + clength[0]); // shift off clt + compact length
1796 RFB.extract_data_uri(this._sock.rQshiftBytes(clength[1]));
1862 if (this._sock.rQwait("cursor encoding", this._FBU.bytes)) { return false; }
1864 this._display.changeCursor(this._sock.rQshiftBytes(pixelslength),
1865 this._sock.rQshiftBytes(masklength),