diff src/myVncProxy/ProxyVncCanvas.java @ 130:cb00150c223e

implement sendEchoPort
author e085711
date Tue, 30 Aug 2011 05:39:12 +0900
parents e3dddee7b934
children 2a90459a05f0
line wrap: on
line diff
--- a/src/myVncProxy/ProxyVncCanvas.java	Mon Aug 08 16:54:34 2011 +0900
+++ b/src/myVncProxy/ProxyVncCanvas.java	Tue Aug 30 05:39:12 2011 +0900
@@ -101,7 +101,7 @@
 		for (int i = 0; i < 256; i++)
 			colors[i] = new Color(cm8.getRGB(i));
 
-//		setPixelFormat();
+		setPixelFormat();
 
 		inputEnabled = false;
 		// Keyboard listener is enabled even in view-only mode, to catch
@@ -211,7 +211,7 @@
 	}
 
 	public void setPixelFormat() throws IOException {
-/*
+
 		if (viewer.options.eightBitColors) {
 			rfb.writeSetPixelFormat(8, 8, false, true, 7, 7, 3, 0, 3, 6);
 			bytesPixel = 1;
@@ -220,7 +220,7 @@
 					0);
 			bytesPixel = 4;
 		}
-*/
+
 		updateFramebufferSize();
 	}
 
@@ -367,6 +367,14 @@
 			 *  read Data from parents and send Data to Client.
 			 */
 			rfb.sendDataToClient();
+
+			if(rfb.returnMsgtype() == RfbProto.FramebufferUpdate ) {
+				boolean fullUpdateNeeded = false;
+				int w = rfb.framebufferWidth;
+				int h = rfb.framebufferHeight;
+				rfb.writeFramebufferUpdateRequest(0, 0, w, h, !fullUpdateNeeded);
+				continue;
+			}
 			
 			long numBytesRead = rfb.getNumBytesRead();
 			
@@ -379,7 +387,11 @@
 				rfb.readSpeedCheck();
 				break;
 			case RfbProto.FramebufferUpdate:
-
+				if(msgType == RfbProto.FramebufferUpdate){ 
+					rfb.is.reset();
+					break;
+				}
+				
 				if (statNumUpdates == viewer.debugStatsExcludeUpdates
 						&& !statsRestarted) {
 					resetStats();
@@ -524,9 +536,11 @@
 			default:
 				throw new Exception("Unknown RFB message type " + msgType);
 			}
+			
+			
 
 			int bufSize = (int)(rfb.getNumBytesRead() - numBytesRead);
-//			System.out.println("bufSize="+bufSize);
+			System.out.println("bufSize="+bufSize);
 //			rfb.bufResetSend(bufSize);