comparison src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java @ 516:1646be890954

add debug code
author mir3636
date Thu, 21 Feb 2019 19:45:56 +0900
parents 91f5c9dc91c8
children 8401dbe0d583
comparison
equal deleted inserted replaced
515:91f5c9dc91c8 516:1646be890954
716 if (dataLen > headerLen) { 716 if (dataLen > headerLen) {
717 ByteBuffer b = multicastqueue.allocate(dataLen - headerLen); 717 ByteBuffer b = multicastqueue.allocate(dataLen - headerLen);
718 reader.readBytes(b.array(), 0, dataLen - headerLen); 718 reader.readBytes(b.array(), 0, dataLen - headerLen);
719 b.limit(dataLen - headerLen); 719 b.limit(dataLen - headerLen);
720 bufs.add(b); 720 bufs.add(b);
721 byte[] bytes1 = b.array();
722 int headerPos = 0; int len2 = b.limit();
723 System.out.println(" bytes: " + bytes1[headerPos + 20] + ", " + bytes1[headerPos + 21] + ", " + bytes1[headerPos + 22] + ", " + bytes1[headerPos + 23]);
724 System.out.println(" bytes: " + bytes1[len2 - 4] + ", " + bytes1[len2 - 3] + ", " + bytes1[len2 - 2] + ", " + bytes1[len2 - 1]);
721 } 725 }
722 multicastqueue.put(bufs); 726 multicastqueue.put(bufs);
723 727
724 return; 728 return;
725 } 729 }
781 deflater.setInput(bytes,prevoffset,span); 785 deflater.setInput(bytes,prevoffset,span);
782 c1rect.height = tiley; 786 c1rect.height = tiley;
783 if (c1.remaining() < span || c1rect.x + c1rect.width + tilex >= rect.x + rect.width ) { 787 if (c1.remaining() < span || c1rect.x + c1rect.width + tilex >= rect.x + rect.width ) {
784 deflater.deflate(c1, Deflater.FULL_FLUSH); 788 deflater.deflate(c1, Deflater.FULL_FLUSH);
785 c1.flip(); 789 c1.flip();
790 System.out.println("multicastPut: " + c1rect + " length: " + c1.remaining());
786 try { 791 try {
787 writeUpdateRectangleWithHeader(c1, c1headerPos, c1.remaining(), c1rect.x, c1rect.y, c1rect.width, c1rect.height); 792 writeUpdateRectangleWithHeader(c1, c1headerPos, c1.remaining(), c1rect.x, c1rect.y, c1rect.width, c1rect.height);
788 } catch (InterruptedException e) { 793 } catch (InterruptedException e) {
789 e.printStackTrace(); 794 e.printStackTrace();
790 } 795 }
813 c1.putInt(headerPos + 16, len2); 818 c1.putInt(headerPos + 16, len2);
814 c1.putShort(headerPos + 4,(short) x); 819 c1.putShort(headerPos + 4,(short) x);
815 c1.putShort(headerPos + 6,(short) y); 820 c1.putShort(headerPos + 6,(short) y);
816 c1.putShort(headerPos + 8,(short) w); 821 c1.putShort(headerPos + 8,(short) w);
817 c1.putShort(headerPos + 10,(short) h); 822 c1.putShort(headerPos + 10,(short) h);
818 c1.flip();
819 LinkedList<ByteBuffer> bufs = new LinkedList<ByteBuffer>(); 823 LinkedList<ByteBuffer> bufs = new LinkedList<ByteBuffer>();
820 bufs.add(c1); 824 bufs.add(c1);
821 if (isTreeManager && connectionPresenter.isUseMulticast()) { 825 if (isTreeManager && connectionPresenter.isUseMulticast()) {
822 for(ByteBuffer buf : bufs) 826 for(ByteBuffer buf : bufs)
823 viewer.getRfbBroadcastListener().multicastUpdateRectangle(buf); 827 viewer.getRfbBroadcastListener().multicastUpdateRectangle(buf);
824 } else 828 } else
825 multicastqueue.waitput(bufs); 829 multicastqueue.waitput(bufs);
830 byte[] bytes = c1.array();
831 System.out.println(" bytes: " + bytes[headerPos + 20] + ", " + bytes[headerPos + 21] + ", " + bytes[headerPos + 22] + ", " + bytes[headerPos + 23]);
832 System.out.println(" bytes: " + bytes[len2 - 4] + ", " + bytes[len2 - 3] + ", " + bytes[len2 - 2] + ", " + bytes[len2 - 1]);
826 } 833 }
827 834
828 public LinkedList<ByteBuffer> createCheckDelayHeader(LinkedList<ByteBuffer> checkDelay, ByteBuffer header) { 835 public LinkedList<ByteBuffer> createCheckDelayHeader(LinkedList<ByteBuffer> checkDelay, ByteBuffer header) {
829 int x = (int) header.getShort(4); 836 int x = (int) header.getShort(4);
830 int y = (int) header.getShort(6); 837 int y = (int) header.getShort(6);