diff src/main/java/jp/ac/u_ryukyu/treevnc/RequestScreenThread.java @ 206:2b3eb4a9492f

MyRfbProto reorganization
author oc
date Wed, 02 Jul 2014 17:58:55 +0900
parents src/main/java/jp/ac/u_ryukyu/treevnc/server/RequestScreenThread.java@8f4c45c1b396
children b31903e5b02d
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/treevnc/RequestScreenThread.java	Wed Jul 02 17:58:55 2014 +0900
@@ -0,0 +1,48 @@
+package jp.ac.u_ryukyu.treevnc;
+
+import com.glavsoft.rfb.protocol.Protocol;
+
+public class RequestScreenThread implements Runnable {
+	public MyRfbProto rfb;
+	Protocol protocol;
+
+	public RequestScreenThread(MyRfbProto _rfb) {
+		rfb = _rfb;
+	}
+
+	
+
+	/* (non-Javadoc)
+	 * @see java.lang.Runnable#run()
+	 * 
+	 * request full screen update every 3 second.
+	 * restart send this immediately.
+	 * nobody call this.
+	 * 
+	 */
+	public void run() {
+		while (true) {
+			try {
+				synchronized(this) {
+					wait();
+				}
+				Thread.sleep(3000);
+				rfb.writeFramebufferUpdateRequest(0, 0, protocol.getFbWidth(),
+						protocol.getFbHeight(), false);
+
+			} catch (Exception e) {
+				e.printStackTrace();
+				break;
+			}
+		}
+	}
+	
+
+    /**
+     * do nothing.
+     */
+    public synchronized void reStart() {
+    	notify();
+    }
+    
+}