view src/main/java/jp/ac/u_ryukyu/treevnc/server/RequestScreenThread.java @ 33:9d3478d11d3b

Add the processing of client
author Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
date Tue, 04 Sep 2012 06:06:17 +0900
parents 18fad65bc447
children
line wrap: on
line source

package jp.ac.u_ryukyu.treevnc.server;

import jp.ac.u_ryukyu.treevnc.MyRfbProto;

import com.glavsoft.rfb.protocol.Protocol;

public class RequestScreenThread implements Runnable {
	MyRfbProto rfb;
	Protocol protocol;

	public RequestScreenThread(MyRfbProto _rfb) {
		rfb = _rfb;
	}

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

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

    public synchronized void reStart() {
    	notify();
    }
    
}