Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 248:e6abf4b0c92e
add numberOfRectangle in checkDelay
author | Miwa Oshiro <e115747@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 24 Oct 2014 14:38:55 +0900 |
parents | dd154ffe1a53 |
children | 6ce5b8dd4525 |
files | src/main/java/com/glavsoft/rfb/protocol/Protocol.java src/main/java/com/glavsoft/rfb/protocol/ProtocolContext.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java |
diffstat | 4 files changed, 23 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Tue Oct 21 10:13:51 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Fri Oct 24 14:38:55 2014 +0900 @@ -319,6 +319,12 @@ } @Override + public int getNumberOfRectangle() { + int numberOfRectangles = receiverTask.numberOfRectangles; + return numberOfRectangles; + } + + @Override public void setTight(boolean isTight) { this.isTight = isTight; }
--- a/src/main/java/com/glavsoft/rfb/protocol/ProtocolContext.java Tue Oct 21 10:13:51 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ProtocolContext.java Fri Oct 24 14:38:55 2014 +0900 @@ -74,7 +74,9 @@ void resetDecoder(); void stopReceiverTask(); - + + int getNumberOfRectangle(); + /** * TreeVNC expension command (server to client) * 0 : command byte
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Tue Oct 21 10:13:51 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Fri Oct 24 14:38:55 2014 +0900 @@ -73,7 +73,7 @@ private TreeRFBProto rfb; private long checkCounter = 0; private boolean firstTime = true; - + public int numberOfRectangles = 0; public ReceiverTask(Reader reader, @@ -209,20 +209,22 @@ public void framebufferUpdateMessage() throws CommonException, UnsupportedEncodingException { reader.readByte(); // padding - int numberOfRectangles = reader.readUInt16(); - + + this.numberOfRectangles = reader.readUInt16(); + int nor = this.numberOfRectangles; + if(rfb.isTreeManager() && firstTime && rfb.checkDelay) { SendCheckDelay sendCheckDelay = new SendCheckDelay(rfb); Thread sendCheckDelayThread = new Thread(sendCheckDelay, "send-check-delay"); sendCheckDelayThread.start(); this.firstTime = false; } - - while (numberOfRectangles-- > 0) { + + while (nor-- > 0) { FramebufferUpdateRectangle rect = new FramebufferUpdateRectangle(); rect.fill(reader); Decoder decoder = decoders.getDecoderByType(rect.getEncodingType()); - logger.finest(rect.toString() + (0 == numberOfRectangles ? "\n---" : "")); + logger.finest(rect.toString() + (0 == nor ? "\n---" : "")); if (decoder != null) { decoder.decode(reader, renderer, rect); // TreeVNC processing here if(!(rfb.getCuiVersion()))
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Tue Oct 21 10:13:51 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Fri Oct 24 14:38:55 2014 +0900 @@ -169,6 +169,10 @@ continue; } } else if (b[0] == ClientToServerMessage.CHECK_DELAY_REPLY) { + + int numberOfRectangle = context.getNumberOfRectangle(); + System.out.println("numberOfRectAngle : " + numberOfRectangle); + ByteBuffer buf = ByteBuffer.wrap(b); buf.order(ByteOrder.BIG_ENDIAN); // getNodeNum(port, hostname, localhostname); @@ -183,10 +187,10 @@ Long delay = System.currentTimeMillis() - time; double halfDelay = (double) delay / 2; System.out.println("nodeNum" + nodeNum + ", port = " + port + ", address = " + address + ", delay = " + halfDelay); - + // checkNodeNum(); // readSendData(check); - + } } else if (b[0] == ClientToServerMessage.SERVER_CHANGE_REQUEST) { ClientToServerMessage sc = new ClientToServerMessage() {