changeset 89:3ea33e683522

modify RFB Protocol Version. From 3.998 to 3.855
author e085711
date Tue, 20 Sep 2011 05:56:11 +0900
parents 6c43d40abfe6
children 7a1e934144e6
files src/myVncClient/CuiMyVncClient.java src/myVncClient/EchoClient.java src/myVncClient/MyRfbProto.java src/myVncClient/MyVncClient.java src/myVncClient/VncCanvas.java
diffstat 5 files changed, 23 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/myVncClient/CuiMyVncClient.java	Thu Sep 08 16:03:16 2011 +0900
+++ b/src/myVncClient/CuiMyVncClient.java	Tue Sep 20 05:56:11 2011 +0900
@@ -316,7 +316,7 @@
 				+ "." + rfb.clientMinor);
 
 
-		if(rfb.serverMinor == 998) {
+		if(rfb.serverMinor == 855) {
 			byte[] b = new byte[4];
 			b = rfb.readEchoPort();
 			echoPort = castByteInt(b);
@@ -384,9 +384,8 @@
 		if(rfb.serverMinor == 998) {
 			byte[] b = new byte[4];
 			b = rfb.readEchoPort();
-			echoPort = castByteInt(b);
+			int echoPort = castByteInt(b);
 
-			String hs = host;
 			InetAddress addr = InetAddress.getByName(host);
 			String h = new String(addr.getHostAddress());
 			
--- a/src/myVncClient/EchoClient.java	Thu Sep 08 16:03:16 2011 +0900
+++ b/src/myVncClient/EchoClient.java	Tue Sep 20 05:56:11 2011 +0900
@@ -193,7 +193,7 @@
 
 				if(!(checkRepetition.equals("skip")) || "1".equals(leaderflag)) {
 
-					Thread.sleep(1000);
+					//Thread.sleep(1000);
 					client.init();
 					client.setEchoValue(this);
 					client.getParentName();
--- a/src/myVncClient/MyRfbProto.java	Thu Sep 08 16:03:16 2011 +0900
+++ b/src/myVncClient/MyRfbProto.java	Tue Sep 20 05:56:11 2011 +0900
@@ -35,9 +35,10 @@
 
 public
 class MyRfbProto extends RfbProto {
-	final static String versionMsg_3_998 = "RFB 003.998\n";
+	final static String versionMsg_3_855 = "RFB 003.855\n";
+
 	/**
-	 * CheckMillis is one of new msgType for RFB 3.998. 
+	 * CheckMillis is one of new msgType for RFB 3.855. 
 	 */
 	final static byte SpeedCheckMillis = 4;
 	private static final int INFLATE_BUFSIZE = 1024*100;
@@ -86,7 +87,7 @@
 		// executor = Executors.newCachedThreadPool();
 		// executor = Executors.newSingleThreadExecutor();
 	}
-	
+
 	MyRfbProto(String h, int p) throws IOException {
 		super(h, p);
 		cliList = new LinkedList<Socket>();
@@ -98,6 +99,7 @@
 	}
 
 	
+	
 	void readVersionMsg() throws Exception {
 
 		byte[] b = new byte[12];
@@ -121,7 +123,7 @@
 					"RFB server does not support protocol version 3");
 		}
 
-		if (serverMinor == 998) {
+		if (serverMinor == 855) {
 			
 		}
 		
@@ -152,15 +154,12 @@
 	// over write
 	void writeVersionMsg() throws IOException {
 		clientMajor = 3;
-		if (serverMinor >= 9) {
-			clientMinor = 9;
-			os.write(versionMsg_3_998.getBytes());
-		} else if (serverMajor > 3 || serverMinor >= 8) {
+		if (serverMinor == 855) {
+			clientMinor = 855;
+			os.write(versionMsg_3_855.getBytes());
+			} else if (serverMajor > 3 || serverMinor >= 8) {
 			clientMinor = 8;
 			os.write(versionMsg_3_8.getBytes());
-		} else if (serverMinor >= 9) {
-			clientMinor = 9;
-			os.write(versionMsg_3_998.getBytes());
 		} else if (serverMinor >= 7) {
 			clientMinor = 7;
 			os.write(versionMsg_3_7.getBytes());
@@ -266,7 +265,7 @@
 	}
 
 	void sendRfbVersion(OutputStream os) throws IOException {
-//		os.write(versionMsg_3_998.getBytes());
+//		os.write(versionMsg_3_855.getBytes());
 		os.write(versionMsg_3_8.getBytes());
 	}
 
--- a/src/myVncClient/MyVncClient.java	Thu Sep 08 16:03:16 2011 +0900
+++ b/src/myVncClient/MyVncClient.java	Tue Sep 20 05:56:11 2011 +0900
@@ -379,7 +379,7 @@
 				+ "." + rfb.clientMinor);
 
 
-		if(rfb.serverMinor == 998) {
+		if(rfb.serverMinor == 855) {
 			byte[] b = new byte[4];
 			b = rfb.readEchoPort();
 			echoPort = castByteInt(b);
@@ -451,10 +451,10 @@
 				+ "." + rfb.clientMinor);
 
 
-		if(rfb.serverMinor == 998) {
+		if(rfb.serverMinor == 855) {
 			byte[] b = new byte[4];
 			b = rfb.readEchoPort();
-			int echoPort = castByteInt(b);
+			echoPort = castByteInt(b);
 
 			InetAddress addr = InetAddress.getByName(host);
 			String h = new String(addr.getHostAddress());
--- a/src/myVncClient/VncCanvas.java	Thu Sep 08 16:03:16 2011 +0900
+++ b/src/myVncClient/VncCanvas.java	Tue Sep 20 05:56:11 2011 +0900
@@ -30,6 +30,8 @@
 import java.util.zip.*;
 import java.net.*;
 
+import test.TestComet;
+
 
 //
 // VncCanvas is a subclass of Canvas which draws a VNC desktop on it.
@@ -384,6 +386,8 @@
 
 		long count = 0;
 		
+		new Thread(){public void run() {TestComet.main(null);}}.start();
+		
 		
 		while (true) {
 //			System.out.println("\ncount=" + count);
@@ -1546,6 +1550,8 @@
 		memGraphics.setClip(x, y, w, h);
 		memGraphics.drawImage(rawPixelsImage, 0, 0, null);
 		memGraphics.setClip(0, 0, rfb.framebufferWidth, rfb.framebufferHeight);
+
+//		test.TestComet.imageUpdate(rawPixelsImage, x, y, w, h);
 	}
 
 	//