view src/treeVnc/RequestScreenThread.java @ 0:756bfaf731f3

create new repository
author Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
date Tue, 21 Feb 2012 04:10:12 +0900
parents
children
line wrap: on
line source

package treeVnc;

import java.io.IOException;

public class RequestScreenThread implements Runnable {
	MyRfbProtoProxy rfb;

	RequestScreenThread(MyRfbProtoProxy _rfb) {
		rfb = _rfb;
	}

	public void run() {
		while (true) {
			try {
				waitThread();
				Thread.sleep(3000);
				rfb.writeFramebufferUpdateRequest(0, 0, rfb.framebufferWidth,
						rfb.framebufferHeight, false);

			} catch (Exception e) {
				e.printStackTrace();
				break;
			}
		}
	}
	
    public synchronized void waitThread() {
    	try{
    		wait();
        }catch(InterruptedException e) {
        	e.printStackTrace();
    	}
    }

    public synchronized void reStart() {
    	notify();
    }
    
    public void checkDelay() throws IOException {
    	rfb.checkDelayData();
    }
    
}