view src/myVncProxy/RequestScreenThread.java @ 162:13458f88d8c9

add RequestScreenThread.java
author e085711
date Wed, 12 Oct 2011 06:45:04 +0900
parents
children
line wrap: on
line source

package myVncProxy;

public class RequestScreenThread implements Runnable {
	MyRfbProto rfb;

	RequestScreenThread(MyRfbProto _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();
    }
    
    
}