view src/main/java/jp/ac/u_ryukyu/treevnc/RequestScreenThread.java @ 434:aad75cd6d9e2

Multicast joins both ipv4 and ipv6 now.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 11 Jun 2016 22:42:58 +0900
parents 42fcc9419498
children
line wrap: on
line source

package jp.ac.u_ryukyu.treevnc;

import com.glavsoft.exceptions.TransportException;
import com.glavsoft.rfb.protocol.Protocol;

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

	public RequestScreenThread(TreeRFBProto _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 (InterruptedException e) {
				e.printStackTrace();
                System.out.println("any thread has interrupted the current thread");
				break;
            }
        }
	}
	

    /**
     * do nothing.
     */
    public synchronized void reStart() {
    	notify();
    }
    
}