Mercurial > hg > Applications > TreeVNC
view src/main/java/jp/ac/u_ryukyu/treevnc/SendCheckDelay.java @ 630:7071b01621c2 default tip
Determine ipv4 or ipv6 and fix scond display
author | riono <e165729@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 28 Apr 2020 19:49:38 +0900 |
parents | aef5cbdd84ab |
children |
line wrap: on
line source
package jp.ac.u_ryukyu.treevnc; import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import java.util.LinkedList; import com.glavsoft.rfb.encoding.EncodingType; public class SendCheckDelay implements Runnable { private TreeRFBProto rfb; public SendCheckDelay(TreeRFBProto rfb) { this.rfb = rfb; } public void sendCheckDelay() { LinkedList<ByteBuffer> checkdelay = new LinkedList<ByteBuffer>(); long time = System.currentTimeMillis(); checkdelay.add(new CheckDelay(0, 0, 0, 0, time, EncodingType.CHECK_DELAY).getMessage()); if (rfb.isAddSerialNum()) { rfb.addSerialNumber(checkdelay); } rfb.multicastqueue.put(checkdelay); System.out.println(time + " : send checkDelay"); } public void run() { for (;;) { long sendTime = 5000; // send check delay timing (5 sec) try { synchronized (this) { wait(sendTime); sendCheckDelay(); } } catch (InterruptedException e) { e.printStackTrace(); System.out.println("any thread has interrupted the current thread"); } } } }