Mercurial > hg > Applications > TreeVNC
view src/main/java/jp/ac/u_ryukyu/treevnc/SoundPacketQueue.java @ 331:42fcc9419498
add error message, add lostParent case by fail to connectTo.
author | oc |
---|---|
date | Tue, 03 Feb 2015 12:31:48 +0900 |
parents | 3ede63861103 |
children | d5138119d8c4 |
line wrap: on
line source
package jp.ac.u_ryukyu.treevnc; import com.glavsoft.rfb.encoding.decoder.ByteBuffer; import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; /** * Created by OcBookPro on 15/01/15. */ public class SoundPacketQueue { private final BlockingQueue<byte[]> queue; public SoundPacketQueue(BlockingQueue<byte[]> queue) { this.queue = queue; } public void put(byte[] packet) { queue.offer(packet); } public byte[] get() throws InterruptedException { return queue.poll(1, TimeUnit.SECONDS); } }