亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rfbproto.java

?? 一個遠程登陸器的原代碼
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
//  Copyright (C) 2002-2004 Ultr@VNC Team.  All Rights Reserved.
//  Copyright (C) 2004 Kenn Min Chong, John Witchel.  All Rights Reserved.
//  Copyright (C) 2001,2002 HorizonLive.com, Inc.  All Rights Reserved.
//  Copyright (C) 2001,2002 Constantin Kaplinsky.  All Rights Reserved.
//  Copyright (C) 2000 Tridia Corporation.  All Rights Reserved.
//  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
//
//  This is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//
//  This software is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this software; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
//  USA.
//

//
// RfbProto.java
//4/19/04

import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.net.Socket;
import java.util.*;
import java.util.zip.*;


class RfbProto {

	final String versionMsg = "RFB 003.003\n";
	final static int ConnFailed = 0, NoAuth = 1, VncAuth = 2, MsLogon = 0xfffffffa;
	final static int VncAuthOK = 0, VncAuthFailed = 1, VncAuthTooMany = 2;

	final static int FramebufferUpdate = 0,
		SetColourMapEntries = 1,
		Bell = 2,
		ServerCutText = 3,
		rfbFileTransfer = 7;

	final int SetPixelFormat = 0,
		FixColourMapEntries = 1,
		SetEncodings = 2,
		FramebufferUpdateRequest = 3,
		KeyboardEvent = 4,
		PointerEvent = 5,
		ClientCutText = 6;

	final static int EncodingRaw = 0,
		EncodingCopyRect = 1,
		EncodingRRE = 2,
		EncodingCoRRE = 4,
		EncodingHextile = 5,
		EncodingZlib = 6,
		EncodingTight = 7,
		EncodingCompressLevel0 = 0xFFFFFF00,
		EncodingQualityLevel0 = 0xFFFFFFE0,
		EncodingXCursor = 0xFFFFFF10,
		EncodingRichCursor = 0xFFFFFF11,
		EncodingPointerPos = 0xFFFFFF18, // marscha - PointerPos
		EncodingLastRect = 0xFFFFFF20,
		EncodingNewFBSize = 0xFFFFFF21;

	final int HextileRaw = (1 << 0);
	final int HextileBackgroundSpecified = (1 << 1);
	final int HextileForegroundSpecified = (1 << 2);
	final int HextileAnySubrects = (1 << 3);
	final int HextileSubrectsColoured = (1 << 4);

	final static int TightExplicitFilter = 0x04;
	final static int TightFill = 0x08;
	final static int TightJpeg = 0x09;
	final static int TightMaxSubencoding = 0x09;
	final static int TightFilterCopy = 0x00;
	final static int TightFilterPalette = 0x01;
	final static int TightFilterGradient = 0x02;

	final static int TightMinToCompress = 12;

	// sf@2004 - FileTransfer part
	ArrayList remoteDirsList;
	ArrayList remoteFilesList;
	ArrayList a;
	boolean fFTInit = true; // sf@2004
	boolean fFTAllowed = true;
	boolean fAbort = false;
	boolean fFileReceptionError = false;
	boolean fFileReceptionRunning = false;
	boolean inDirectory2;
	FileOutputStream fos;
	FileInputStream fis;
	String sendFileSource;
	String receivePath;
	long fileSize;
	long receiveFileSize;
	long fileChunkCounter;

	final static int sz_rfbFileTransferMsg = 12,
	// FileTransfer Content types and Params defines
	rfbDirContentRequest = 1,
	// Client asks for the content of a given Server directory
	rfbDirPacket = 2, // Full directory name or full file name.
	// Null content means end of Directory
	rfbFileTransferRequest = 3,
	// Client asks the server for the tranfer of a given file
	rfbFileHeader = 4,
	// First packet of a file transfer, containing file's features
	rfbFilePacket = 5, // One slice of the file
	rfbEndOfFile = 6,
	// End of file transfer (the file has been received or error)
	rfbAbortFileTransfer = 7,
	// The file transfer must be aborted, whatever the state
	rfbFileTransferOffer = 8,
	// The client offers to send a file to the server
	rfbFileAcceptHeader = 9, // The server accepts or rejects the file
	rfbCommand = 10,
	// The Client sends a simple command (File Delete, Dir create etc...)
	rfbCommandReturn = 11,
	//	New FT Protocole (V2) The zipped checksums of the destination file (Delta Transfer)
	rfbFileChecksums = 12,
	// The Client receives the server's answer about a simple command
	// rfbDirContentRequest client Request - content params 
	rfbRDirContent = 1, // Request a Server Directory contents
	rfbRDrivesList = 2, // Request the server's drives list
	
	// rfbDirPacket & rfbCommandReturn  server Answer - content params
	rfbADirectory = 1, // Reception of a directory name
	rfbAFile = 2, // Reception of a file name 
	rfbADrivesList = 3, // Reception of a list of drives
	rfbADirCreate = 4, // Response to a create dir command 
	rfbADirDelete = 5, // Response to a delete dir command 
	rfbAFileCreate = 6, // Response to a create file command 
	rfbAFileDelete = 7, // Response to a delete file command
	
	// rfbCommand Command - content params
	rfbCDirCreate = 1, // Request the server to create the given directory
	rfbCDirDelete = 2, // Request the server to delete the given directory
	rfbCFileCreate = 3, // Request the server to create the given file
	rfbCFileDelete = 4, // Request the server to delete the given file
	
	// Errors - content params or "size" field
	rfbRErrorUnknownCmd = 1, // Unknown FileTransfer command.
	rfbRErrorCmd = 0xFFFFFFFF,
	
	// Error when a command fails on remote side (ret in "size" field)
	sz_rfbBlockSize = 8192, // new FT protocole (v2)
	
	// Size of a File Transfer packet (before compression)
	sz_rfbZipDirectoryPrefix = 9;

	String rfbZipDirectoryPrefix = "!UVNCDIR-\0";
	// Transfered directory are zipped in a file with this prefix. Must end with "-"
	
	// End of FileTransfer part 
	
	String host;
	int port;
	Socket sock;
	DataInputStream is;
	OutputStream os;
	OutputStreamWriter osw;

	SessionRecorder rec;
	boolean inNormalProtocol = false;
	VncViewer viewer;

	// Java on UNIX does not call keyPressed() on some keys, for example
	// swedish keys To prevent our workaround to produce duplicate
	// keypresses on JVMs that actually works, keep track of if
	// keyPressed() for a "broken" key was called or not. 
	boolean brokenKeyPressed = false;

	// This will be set to true on the first framebuffer update
	// containing Zlib- or Tight-encoded data.
	boolean wereZlibUpdates = false;

	// This will be set to false if the startSession() was called after
	// we have received at least one Zlib- or Tight-encoded framebuffer
	// update.
	boolean recordFromBeginning = true;

	// This fields are needed to show warnings about inefficiently saved
	// sessions only once per each saved session file.
	boolean zlibWarningShown;
	boolean tightWarningShown;

	// Before starting to record each saved session, we set this field
	// to 0, and increment on each framebuffer update. We don't flush
	// the SessionRecorder data into the file before the second update. 
	// This allows us to write initial framebuffer update with zero
	// timestamp, to let the player show initial desktop before
	// playback.
	int numUpdatesInSession;

	//
	// Constructor. Make TCP connection to RFB server.
	//

	RfbProto(String h, int p, VncViewer v) throws IOException {
		viewer = v;
		host = h;
		port = p;
		sock = new Socket(host, port);
		is =
			new DataInputStream(
				new BufferedInputStream(sock.getInputStream(), 16384));
		os = sock.getOutputStream();
		osw = new OutputStreamWriter(sock.getOutputStream());
		inDirectory2 = false;
		a = new ArrayList();
		// sf@2004
		remoteDirsList = new ArrayList();
		remoteFilesList = new ArrayList();
	
		sendFileSource = "";
	}

	void close() {
		try {
			sock.close();
			if (rec != null) {
				rec.close();
				rec = null;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	//
	// Read server's protocol version message
	//

	int serverMajor, serverMinor;

	void readVersionMsg() throws Exception {

		byte[] b = new byte[12];

		is.readFully(b);

		if ((b[0] != 'R')
			|| (b[1] != 'F')
			|| (b[2] != 'B')
			|| (b[3] != ' ')
			|| (b[4] < '0')
			|| (b[4] > '9')
			|| (b[5] < '0')
			|| (b[5] > '9')
			|| (b[6] < '0')
			|| (b[6] > '9')
			|| (b[7] != '.')
			|| (b[8] < '0')
			|| (b[8] > '9')
			|| (b[9] < '0')
			|| (b[9] > '9')
			|| (b[10] < '0')
			|| (b[10] > '9')
			|| (b[11] != '\n')) {
			throw new Exception(
				"Host " + host + " port " + port + " is not an RFB server");
		}

		serverMajor = (b[4] - '0') * 100 + (b[5] - '0') * 10 + (b[6] - '0');
		serverMinor = (b[8] - '0') * 100 + (b[9] - '0') * 10 + (b[10] - '0');
	}

	//
	// Write our protocol version message
	//

	void writeVersionMsg() throws IOException {
		os.write(versionMsg.getBytes());
	}

	//
	// Find out the authentication scheme.
	//

	int readAuthScheme() throws Exception {
		int authScheme = is.readInt();

		switch (authScheme) {

			case ConnFailed :
				int reasonLen = is.readInt();
				byte[] reason = new byte[reasonLen];
				is.readFully(reason);
				throw new Exception(new String(reason));

			case NoAuth :
			case VncAuth :
			case MsLogon:
				return authScheme;

			default :
				throw new Exception(
					"Unknown authentication scheme from RFB server: "
						+ authScheme);

		}
	}

	//
	// Write the client initialisation message
	//

	void writeClientInit() throws IOException {
		if (viewer.options.shareDesktop) {
			os.write(1);
		} else {
			os.write(0);
		}
		viewer.options.disableShareDesktop();
	}

	//
	// Read the server initialisation message
	//

	String desktopName;
	int framebufferWidth, framebufferHeight;
	int bitsPerPixel, depth;
	boolean bigEndian, trueColour;
	int redMax, greenMax, blueMax, redShift, greenShift, blueShift;

	void readServerInit() throws IOException {
		framebufferWidth = is.readUnsignedShort();
		framebufferHeight = is.readUnsignedShort();
		bitsPerPixel = is.readUnsignedByte();
		depth = is.readUnsignedByte();
		bigEndian = (is.readUnsignedByte() != 0);
		trueColour = (is.readUnsignedByte() != 0);
		redMax = is.readUnsignedShort();
		greenMax = is.readUnsignedShort();
		blueMax = is.readUnsignedShort();
		redShift = is.readUnsignedByte();
		greenShift = is.readUnsignedByte();
		blueShift = is.readUnsignedByte();
		byte[] pad = new byte[3];
		is.readFully(pad);
		int nameLength = is.readInt();
		byte[] name = new byte[nameLength];
		is.readFully(name);
		desktopName = new String(name);

		inNormalProtocol = true;
	}

	//
	// Create session file and write initial protocol messages into it.
	//

	void startSession(String fname) throws IOException {
		rec = new SessionRecorder(fname);
		rec.writeHeader();
		rec.write(versionMsg.getBytes());
		rec.writeIntBE(NoAuth);
		rec.writeShortBE(framebufferWidth);
		rec.writeShortBE(framebufferHeight);
		byte[] fbsServerInitMsg =
			{
				32,
				24,
				0,
				1,
				0,
				(byte) 0xFF,
				0,
				(byte) 0xFF,
				0,
				(byte) 0xFF,
				16,
				8,
				0,
				0,
				0,
				0 };
		rec.write(fbsServerInitMsg);
		rec.writeIntBE(desktopName.length());
		rec.write(desktopName.getBytes());
		numUpdatesInSession = 0;

		if (wereZlibUpdates)
			recordFromBeginning = false;

		zlibWarningShown = false;
		tightWarningShown = false;
	}

	//
	// Close session file.
	//

	void closeSession() throws IOException {
		if (rec != null) {
			rec.close();
			rec = null;
		}
	}

	//
	// Set new framebuffer size
	//

	void setFramebufferSize(int width, int height) {
		framebufferWidth = width;
		framebufferHeight = height;
	}

	//
	// Read the server message type
	//

	int readServerMessageType() throws IOException {
		int msgType = is.readUnsignedByte();

		// If the session is being recorded:
		if (rec != null) {
			if (msgType == Bell) { // Save Bell messages in session files.
				rec.writeByte(msgType);
				if (numUpdatesInSession > 0)
					rec.flush();
			}
		}

		return msgType;
	}

	//
	// Read a FramebufferUpdate message
	//

	int updateNRects;

	void readFramebufferUpdate() throws IOException {
		is.readByte();
		updateNRects = is.readUnsignedShort();

		// If the session is being recorded:
		if (rec != null) {
			rec.writeByte(FramebufferUpdate);
			rec.writeByte(0);
			rec.writeShortBE(updateNRects);
		}

		numUpdatesInSession++;
	}

	// Read a FramebufferUpdate rectangle header

	int updateRectX, updateRectY, updateRectW, updateRectH, updateRectEncoding;

	void readFramebufferUpdateRectHdr() throws Exception {
		updateRectX = is.readUnsignedShort();
		updateRectY = is.readUnsignedShort();
		updateRectW = is.readUnsignedShort();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲18色成人| 欧美日韩一区不卡| 欧美日韩一区不卡| 国产精品嫩草久久久久| 美国欧美日韩国产在线播放| 不卡的av中国片| 欧美刺激脚交jootjob| 国产精品久久综合| 奇米一区二区三区| 欧日韩精品视频| 国产女主播视频一区二区| 麻豆国产精品一区二区三区 | 综合久久给合久久狠狠狠97色| 亚洲成人av电影在线| aaa国产一区| 国产欧美久久久精品影院| 日韩一区精品视频| 欧美亚洲日本一区| 一区二区三区高清| av影院午夜一区| 国产精品美女久久久久久久久久久 | 在线视频你懂得一区| 久久精品视频网| 国产精一品亚洲二区在线视频| 6080午夜不卡| 日本中文一区二区三区| 欧美日本一区二区| 偷拍与自拍一区| 9191精品国产综合久久久久久| 一区二区三区精品在线| 91成人在线精品| 亚洲一二三区在线观看| 欧美中文字幕一区二区三区亚洲| 亚洲精品乱码久久久久久久久| av亚洲精华国产精华| 亚洲欧洲日本在线| 91精品福利视频| 又紧又大又爽精品一区二区| 色狠狠一区二区| 亚洲国产乱码最新视频| 欧美色手机在线观看| 日韩国产精品91| 亚洲精品在线一区二区| 国产精品性做久久久久久| 中文字幕不卡在线| 91麻豆精品一区二区三区| 亚洲一区在线看| 日韩一级在线观看| 国产成人夜色高潮福利影视| 一区二区中文字幕在线| 在线观看亚洲一区| 日韩一区精品字幕| 久久午夜色播影院免费高清| 成人国产精品免费观看视频| 亚洲男人电影天堂| 538在线一区二区精品国产| 国产精品资源站在线| 国产精品美女久久久久久久| 在线免费观看成人短视频| 日韩精品色哟哟| 中文字幕国产一区二区| 欧美日韩国产区一| 国产成人欧美日韩在线电影| 亚洲激情图片qvod| 久久综合色一综合色88| 色先锋资源久久综合| 精品一区二区国语对白| 亚洲日本在线观看| 日韩女优视频免费观看| 99热这里都是精品| 久久精品国产亚洲一区二区三区| 国产精品久久久久四虎| 欧美日韩国产综合一区二区 | 91蜜桃免费观看视频| 日韩国产欧美在线观看| 国产精品欧美久久久久无广告| 欧美日韩性生活| 成人小视频在线| 另类小说图片综合网| 亚洲免费看黄网站| 久久精品视频免费观看| 欧美久久久一区| aa级大片欧美| 国产精品白丝jk黑袜喷水| 天堂久久一区二区三区| 国产精品另类一区| 精品国产1区2区3区| 欧美视频一区二| 99re成人在线| 国产+成+人+亚洲欧洲自线| 人人狠狠综合久久亚洲| 亚洲午夜久久久久久久久电影网 | 久久99热狠狠色一区二区| 亚洲一区二区影院| 国产精品免费丝袜| 国产亚洲欧美日韩在线一区| 日韩午夜av一区| 欧美中文字幕一区| 日本道精品一区二区三区| 丁香天五香天堂综合| 久久精品国产一区二区三区免费看 | 亚洲欧洲国产日本综合| 久久先锋影音av鲁色资源| 3atv在线一区二区三区| 欧美天天综合网| 色8久久人人97超碰香蕉987| 91亚洲精华国产精华精华液| 成人免费看视频| 成人短视频下载| 不卡的电视剧免费网站有什么| 国产高清精品在线| 国产精品18久久久久久久久| 国产一区二区三区观看| 国产一区不卡在线| 国产黄色精品网站| 九九精品视频在线看| 国产在线一区观看| 国产精品99久久久| 不卡一区中文字幕| 91黄色激情网站| 欧美剧在线免费观看网站| 欧美一区二区三区四区高清| 欧美一区二区三区婷婷月色| 日韩欧美一区二区在线视频| 日韩欧美一级片| 国产女人aaa级久久久级| 国产精品乱人伦| 亚洲综合在线视频| 亚洲成a人在线观看| 久久精品国产亚洲aⅴ| 国产精品一区二区无线| 成人午夜免费视频| 91麻豆免费看| 777亚洲妇女| 久久久99免费| 一区二区三区欧美久久| 亚洲成av人片在线观看无码| 日本欧美肥老太交大片| 国产91丝袜在线播放0| 91无套直看片红桃| 在线电影院国产精品| 26uuu亚洲| 综合网在线视频| 日韩在线一区二区三区| 国产精品自在在线| 在线观看一区日韩| 久久综合999| 一区二区三区在线免费播放| 欧美bbbbb| 92精品国产成人观看免费| 欧美一区二区三区小说| 国产精品蜜臀在线观看| 日韩主播视频在线| 国产成人免费网站| 6080yy午夜一二三区久久| 中文字幕精品三区| 日本视频中文字幕一区二区三区| 国产伦精品一区二区三区在线观看| 成人高清视频在线观看| 7777精品伊人久久久大香线蕉完整版| 久久色中文字幕| 午夜欧美大尺度福利影院在线看| 国产成人超碰人人澡人人澡| 欧美高清视频在线高清观看mv色露露十八| 日韩精品中文字幕一区| 亚洲黄色小视频| 国产精品66部| 欧美一区二区三区的| 亚洲欧美激情插| 国产河南妇女毛片精品久久久| 欧美精品九九99久久| 亚洲色图第一区| 国产大陆a不卡| 精品剧情在线观看| 亚洲第一精品在线| 日本韩国一区二区三区视频| 久久亚洲一区二区三区四区| 亚洲成人777| 欧美在线色视频| 一区二区三区中文字幕精品精品| 丰满岳乱妇一区二区三区| 日韩欧美在线综合网| 亚洲国产精品久久不卡毛片| 91丝袜高跟美女视频| 欧美极品少妇xxxxⅹ高跟鞋 | 国产精品无人区| 国产精品中文字幕欧美| 日韩亚洲欧美综合| 天天亚洲美女在线视频| 欧美性猛片aaaaaaa做受| 亚洲男同性恋视频| 色狠狠一区二区| 亚洲一区二区三区在线看| 91看片淫黄大片一级在线观看| 中国色在线观看另类| 成人app在线观看| 一区在线播放视频| 色综合天天性综合| 亚洲美女免费在线| 欧美体内she精高潮|