changeset 78:fe94e353d595

modify
author e085711
date Tue, 30 Aug 2011 18:33:24 +0900
parents 42b08ecc4cb5
children c76e43a12796
files src/myVncClient/CuiMyVncClient.java src/myVncClient/CuiVncCanvas.java src/myVncClient/MyRfbProto.java
diffstat 3 files changed, 32 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/myVncClient/CuiMyVncClient.java	Tue Aug 30 17:49:42 2011 +0900
+++ b/src/myVncClient/CuiMyVncClient.java	Tue Aug 30 18:33:24 2011 +0900
@@ -310,6 +310,7 @@
 			b = rfb.readEchoPort();
 			int echoPort = castByteInt(b);
 
+			String hs = host;
 			InetAddress addr = InetAddress.getByName(host);
 			String h = new String(addr.getHostAddress());
 			
@@ -989,6 +990,29 @@
 				value = echo.Interruption(clientSocket);
 			}
 		}	
+
+		// proxyからの返信で接続先を決定する
+		host = value.responseLine;
+		parent = value.parent;
+		if (value.treenum != null) {
+			treenum = value.treenum;
+		} else {
+			treenum = echo.treenum;
+		}
+		if (value.leaderflag != null) {
+			leaderflag = value.leaderflag;
+		} else {
+			leaderflag = echo.leaderflag;
+		}
+		System.out.println("Parent =" + parent);
+		System.out.println("mynumber =" + treenum);
+		System.out.println("connect host =" + host);
+		System.out.println("leaderflag(boolean) = " + leaderflag);
+
+		echo = value;
+
+
+//		port = 5999;		
 		
 	}
 	
--- a/src/myVncClient/CuiVncCanvas.java	Tue Aug 30 17:49:42 2011 +0900
+++ b/src/myVncClient/CuiVncCanvas.java	Tue Aug 30 18:33:24 2011 +0900
@@ -455,6 +455,10 @@
 						statNumRectsZRLE++;
 						handleZRLERect(rx, ry, rw, rh);
 						break;
+					case RfbProto.EncodingZRLEE:
+						statNumRectsZRLE++;
+						handleZRLERect(rx, ry, rw, rh);
+						break;
 					case RfbProto.EncodingZlib:
 						handleZlibRect(rx, ry, rw, rh);
 						break;
@@ -872,6 +876,7 @@
 	//
 
 	void handleZRLERect(int x, int y, int w, int h) throws Exception {
+		if (rfb.updateRectEncoding==RfbProto.EncodingZRLEE) zrleInStream = null;
 
 		if (zrleInStream == null)
 			zrleInStream = new ZlibInStream();
--- a/src/myVncClient/MyRfbProto.java	Tue Aug 30 17:49:42 2011 +0900
+++ b/src/myVncClient/MyRfbProto.java	Tue Aug 30 18:33:24 2011 +0900
@@ -266,7 +266,8 @@
 	}
 
 	void sendRfbVersion(OutputStream os) throws IOException {
-		os.write(versionMsg_3_998.getBytes());
+//		os.write(versionMsg_3_998.getBytes());
+		os.write(versionMsg_3_8.getBytes());
 	}
 
 	void readVersionMsg(InputStream is) throws IOException {
@@ -367,7 +368,7 @@
 		rectW = readU16();           //  8
 		rectH = readU16();           //  10
 		encoding = readU32();      //   12
-		System.out.println("encoding = "+encoding);
+//		System.out.println("encoding = "+encoding);
 		if (encoding == EncodingZRLE|| encoding==EncodingZRLEE||encoding==EncodingZlib)
 			zLen = readU32();
 		else