Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 520:3a9dadc8821f
multicast packet is recieved
author | mir3636 |
---|---|
date | Fri, 22 Feb 2019 15:42:41 +0900 |
parents | d17c048f356f |
children | 3fc0fedbc3fd |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/main/java/jp/ac/u_ryukyu/treevnc/BroadcastRFBListener.java src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java |
diffstat | 4 files changed, 10 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java Fri Feb 22 15:05:21 2019 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java Fri Feb 22 15:42:41 2019 +0900 @@ -26,7 +26,7 @@ // TreeVNC handling int dataLen = getZrleLength(rect, reader); reader.reset(); - System.out.println("ZRLEESender: " + rect + " length: " + dataLen); + //System.out.println("ZRLEESender: " + rect + " length: " + dataLen); if (rfb.hasViewer()) { ZRLEDecoder decoder = new ZRLEDecoder(); if (rect.getEncodingType() == EncodingType.ZRLE) {
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Fri Feb 22 15:05:21 2019 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Fri Feb 22 15:42:41 2019 +0900 @@ -142,12 +142,6 @@ break; default: logger.severe("Unsupported server message. Id = " + messageId); - for(int i = 0; (i < 20) && reader.available()>0; i++) { - byte[] x = {0}; - reader.readBytes(x); - System.out.print(" "+x[0]); - } - System.out.println(); } } catch (TransportException e) { System.out.println(e.getMessage());
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/BroadcastRFBListener.java Fri Feb 22 15:05:21 2019 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/BroadcastRFBListener.java Fri Feb 22 15:42:41 2019 +0900 @@ -21,7 +21,7 @@ public static final String Ipv6McastAddr = "ff02::1"; public static String McastAddr = Ipv4McastAddr; - static final int BufSize = 1024; + static final int BufSize = 1024*64; private ReceiverTask receiverTask; private boolean stopFlag = false; private TreeRFBProto rfb;
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Fri Feb 22 15:05:21 2019 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Fri Feb 22 15:42:41 2019 +0900 @@ -718,11 +718,6 @@ reader.readBytes(b.array(), 0, dataLen - headerLen); b.limit(dataLen - headerLen); bufs.add(b); - byte[] bytes1 = b.array(); - int headerPos = 4; int len2 = b.limit(); - System.out.println(" bytes: " + bytes1[headerPos + 20] + ", " + bytes1[headerPos + 21] + ", " + bytes1[headerPos + 22] + ", " + bytes1[headerPos + 23]); - System.out.println(" bytes: " + bytes1[len2 - 8] + ", " + bytes1[len2 - 7] + ", " + bytes1[len2 - 6] + ", " + bytes1[len2 - 5]); - System.out.println(" bytes: " + bytes1[len2 - 4] + ", " + bytes1[len2 - 3] + ", " + bytes1[len2 - 2] + ", " + bytes1[len2 - 1]); } multicastqueue.put(bufs); @@ -790,7 +785,7 @@ deflater.deflate(c1, Deflater.FULL_FLUSH); deflater.finish(); c1.flip(); - System.out.println("multicastPut: " + c1rect + " length: " + (c1.remaining()-c1headerPos-header.limit())); + //System.out.println("multicastPut: " + c1rect + " length: " + (c1.remaining()-c1headerPos-header.limit())); try { writeUpdateRectangleWithHeader(c1, c1headerPos, c1.remaining()-c1headerPos-header.limit()-4, c1rect.x, c1rect.y, c1rect.width, c1rect.height); } catch (InterruptedException e) { @@ -842,21 +837,18 @@ deflater.reset(); c1.putInt(headerPos + 16, len2); - c1.putShort(headerPos + 4,(short) x); - c1.putShort(headerPos + 6,(short) y); - c1.putShort(headerPos + 8,(short) w); - c1.putShort(headerPos + 10,(short) h); + c1.putShort(headerPos + 4, (short) x); + c1.putShort(headerPos + 6, (short) y); + c1.putShort(headerPos + 8, (short) w); + c1.putShort(headerPos + 10, (short) h); LinkedList<ByteBuffer> bufs = new LinkedList<ByteBuffer>(); bufs.add(c1); if (isTreeManager && connectionPresenter.isUseMulticast()) { - for(ByteBuffer buf : bufs) + for (ByteBuffer buf : bufs) viewer.getRfbBroadcastListener().multicastUpdateRectangle(buf); - } else + } else { multicastqueue.waitput(bufs); - byte[] bytes = c1.array(); - len2 = c1.remaining(); - System.out.println(" bytes: " + bytes[headerPos + 20] + ", " + bytes[headerPos + 21] + ", " + bytes[headerPos + 22] + ", " + bytes[headerPos + 23]); - System.out.println(" bytes: " + bytes[len2 - 4] + ", " + bytes[len2 - 3] + ", " + bytes[len2 - 2] + ", " + bytes[len2 - 1]); + } } public LinkedList<ByteBuffer> createCheckDelayHeader(LinkedList<ByteBuffer> checkDelay, ByteBuffer header) {