view src/myVncProxy/RequestScreenThread.java @ 177:2a9dd76dde5f

merge 167
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 25 Oct 2011 00:22:51 +0900
parents 13458f88d8c9
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();
    }
    
    
}