Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 227:2cb2279ca95c
send checkdelay time.
author | Miwa Oshiro <e115747@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 06 Oct 2014 10:57:55 +0900 |
parents | b7247e31b5ba |
children | 358484c9d4a3 |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/FramebufferUpdateRectangle.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java src/main/java/jp/ac/u_ryukyu/treevnc/UpdateRectangleMessage.java |
diffstat | 4 files changed, 15 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/FramebufferUpdateRectangle.java Sun Oct 05 16:09:23 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/FramebufferUpdateRectangle.java Mon Oct 06 10:57:55 2014 +0900 @@ -43,6 +43,7 @@ public int width; public int height; private EncodingType encodingType; + public long time; public FramebufferUpdateRectangle() { // nop @@ -62,7 +63,8 @@ encodingType = EncodingType.byId(encoding); if (encoding == 17) { - System.out.println("checkdelay~~~~~~"); + time = reader.readInt64(); + System.out.println("time = " + time); } }
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Sun Oct 05 16:09:23 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Mon Oct 06 10:57:55 2014 +0900 @@ -34,6 +34,7 @@ import com.glavsoft.rfb.client.SetPixelFormatMessage; import com.glavsoft.rfb.encoding.EncodingType; import com.glavsoft.rfb.encoding.PixelFormat; +import com.glavsoft.rfb.encoding.decoder.CheckDelayRectangle; import com.glavsoft.rfb.encoding.decoder.Decoder; import com.glavsoft.rfb.encoding.decoder.DecodersContainer; import com.glavsoft.rfb.encoding.decoder.FramebufferUpdateRectangle; @@ -226,7 +227,7 @@ while (numberOfRectangles-- > 0) { FramebufferUpdateRectangle rect = new FramebufferUpdateRectangle(); rect.fill(reader); - + Decoder decoder = decoders.getDecoderByType(rect.getEncodingType()); logger.finest(rect.toString() + (0 == numberOfRectangles ? "\n---" : "")); if (decoder != null) { @@ -267,8 +268,9 @@ } context.sendMessage(new FramebufferUpdateRequestMessage(0, 0, rect.width, rect.height, false)); // repaintController.repaintCursor(); - } else if (rect.getEncodingType() == EncodingType.CHECK_DELAY ) { + } else if (rect.getEncodingType() == EncodingType.CHECK_DELAY) { readCheckDelay(reader); + System.out.println("rect.time=" + rect.time); } else throw new CommonException("Unprocessed encoding: " + rect.toString()); } @@ -291,6 +293,7 @@ private void readCheckDelay(Reader reader) { System.out.println("read check delay."); + // データを読み込む処理 } public synchronized void queueUpdatePixelFormat(PixelFormat pf) {
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Sun Oct 05 16:09:23 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Mon Oct 06 10:57:55 2014 +0900 @@ -543,7 +543,9 @@ int encoding = header.getInt(12); LinkedList<ByteBuffer> checkdelay = new LinkedList<ByteBuffer>(); - checkdelay.add(new UpdateRectangleMessage(0, 0, 0, 0, EncodingType.CHECK_DELAY).getMessage()); + long time = System.currentTimeMillis(); +// System.out.println("time =" + time); + checkdelay.add(new UpdateRectangleMessage(0, 0, 0, 0, time, EncodingType.CHECK_DELAY).getMessage()); this.addSerialNumber(checkdelay); multicastqueue.put(checkdelay);
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/UpdateRectangleMessage.java Sun Oct 05 16:09:23 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/UpdateRectangleMessage.java Mon Oct 06 10:57:55 2014 +0900 @@ -8,10 +8,11 @@ public class UpdateRectangleMessage { private ByteBuffer msg; + - public UpdateRectangleMessage(int i, int j, int width, int height, + public UpdateRectangleMessage(int i, int j, int width, int height, long time, EncodingType desktopSize) { - msg = ByteBuffer.allocate(16).order(ByteOrder.BIG_ENDIAN); + msg = ByteBuffer.allocate(24).order(ByteOrder.BIG_ENDIAN); msg.put((byte) 0); // FrameBufferUpdate msg.put((byte) 0); // padding msg.putShort((short) 1234); // number of rectangle @@ -20,6 +21,7 @@ msg.putShort((short) width); msg.putShort((short) height); msg.putInt(desktopSize.getId()); + msg.putLong(time); msg.flip();