view src/main/java/jp/ac/u_ryukyu/treevnc/server/RequestScreenThread.java @ 88:a719aa609e14

add name valuer threads.
author oc
date Thu, 01 May 2014 19:12:05 +0900
parents 9d3478d11d3b
children 8f4c45c1b396
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;
	}

	

	/* (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();
    }
    
}