Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 241:b21a7842a41d
add option addSerialNum.
author | oc |
---|---|
date | Mon, 13 Oct 2014 13:16:49 +0900 |
parents | 7310e7d7a45f |
children | a640cd7001e1 |
files | src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/main/java/jp/ac/u_ryukyu/treevnc/SendCheckDelay.java src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java src/viewer_swing/java/com/glavsoft/viewer/Viewer.java src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java |
diffstat | 7 files changed, 33 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Sun Oct 12 23:05:47 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Mon Oct 13 13:16:49 2014 +0900 @@ -110,7 +110,9 @@ if(! rfb.isTreeManager()) { // client has 8byte packet sequence number reader.mark(28); - getLost(reader); //check seq consistency + if (rfb.addSerialNum) { + getLost(reader); //check seq consistency + } } else { reader.mark(20); }
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/SendCheckDelay.java Sun Oct 12 23:05:47 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/SendCheckDelay.java Mon Oct 13 13:16:49 2014 +0900 @@ -20,7 +20,9 @@ LinkedList<ByteBuffer> checkdelay = new LinkedList<ByteBuffer>(); long time = System.currentTimeMillis(); checkdelay.add(new CheckDelay(0, 0, 0, 0, time, EncodingType.CHECK_DELAY).getMessage()); - rfb.addSerialNumber(checkdelay); + if (rfb.addSerialNum) { + rfb.addSerialNumber(checkdelay); + } rfb.multicastqueue.put(checkdelay); }
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Sun Oct 12 23:05:47 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Mon Oct 13 13:16:49 2014 +0900 @@ -65,6 +65,7 @@ private String vncInterface; public LinkedList<TreeVNCNode> nodeList; public boolean checkDelay = false; + public boolean addSerialNum = false; public TreeRFBProto(boolean isTreeManager) { @@ -434,7 +435,9 @@ int width = context.getFbWidth(); int height = context.getFbHeight(); desktopSize.add(new UpdateRectangleMessage(width, height, EncodingType.INIT_DATA, context.getInitData(),id).getMessage()); - addSerialNumber(desktopSize); + if (addSerialNum) { + addSerialNumber(desktopSize); + } multicastqueue.put(desktopSize); } @@ -602,7 +605,9 @@ blen.flip(); bufs.addFirst(blen); bufs.addFirst(header); - addSerialNumber(bufs); + if (addSerialNum) { + addSerialNumber(bufs); + } multicastqueue.put(bufs); } catch (DataFormatException e) { throw new TransportException(e); @@ -620,7 +625,9 @@ b.limit(dataLen - 16); bufs.add(b); } - this.addSerialNumber(bufs); + if (addSerialNum) { + this.addSerialNumber(bufs); + } multicastqueue.put(bufs); return; @@ -701,11 +708,6 @@ getCast = new TreeRootFinderListener(v); Thread treeRootFindThread = new Thread(getCast, "tree-root-find-listener"); treeRootFindThread.start(); - /* - sendCheckDelay = new SendCheckDelay(); - Thread sendCheckDelayThread = new Thread(sendCheckDelay, "send-check-delay"); - sendCheckDelayThread.start(); - */ firstTime = false; } } @@ -752,6 +754,10 @@ this.checkDelay = checkDelay; } + public void setAddSerialNum(boolean addSerialNum) { + this.addSerialNum = addSerialNum; + } + public int getNodeNum(int port, String address) { int nodeNum = 0; @@ -764,4 +770,5 @@ } return nodeNum; } + } \ No newline at end of file
--- a/src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java Sun Oct 12 23:05:47 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java Mon Oct 13 13:16:49 2014 +0900 @@ -259,7 +259,7 @@ } @Override - public void proxyStart(String[] args, int width, int height, boolean showTree, boolean checkDelay) { + public void proxyStart(String[] args, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum) { }
--- a/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Sun Oct 12 23:05:47 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Mon Oct 13 13:16:49 2014 +0900 @@ -13,6 +13,7 @@ private boolean permitChangeScreen = true; private boolean showTree = false; private boolean checkDelay = false; + private boolean addSerialNum = false; public static void main(String[] args) { new TreeViewer().vncStart(args); @@ -43,7 +44,7 @@ public void rootStart(String[] args, ViewerInterface v) { v.setNoConnection(noConnection); // should we accept host name here? - v.proxyStart(args,width,height, showTree, checkDelay); + v.proxyStart(args,width,height, showTree, checkDelay, addSerialNum); v.getRfb().setHasViewer(viewer); if (!permitChangeScreen ) v.getRfb().setPermitChangeScreen(false); v.getRfb().getAcceptThread().waitForShutdown(); @@ -94,8 +95,11 @@ // show Tree node. showTree = true; } else if ("--checkDelay".equals(args[i])) { - // check delay + // check flow of data delay. checkDelay = true; + } else if ("--addSerialNum".equals(args[i])) { + // add data serial number. + addSerialNum = true; } else { System.out.println("(default) TreeVNCClient\n" + "-v or -c: View shared screen.\n" @@ -108,7 +112,8 @@ + "--width w: Set display width.\n" + "--height h: Set display height.\n" + "--showTree: Show connected tree node.\n" - + "--checkDelay: Check speed flow of data each node.\n"); + + "--checkDelay: Check speed flow of data each node.\n" + + "--addSerialNum: Check lost data.\n"); } } }
--- a/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Sun Oct 12 23:05:47 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Mon Oct 13 13:16:49 2014 +0900 @@ -363,7 +363,7 @@ run(); } - public void proxyStart(String[] argv, int width, int height, boolean showTree, boolean checkDelay) { + public void proxyStart(String[] argv, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum) { fbWidth = width; this.showTree = showTree; // input into arguments Decision @@ -380,6 +380,7 @@ myRfb = rfb; rfb.setShowTree(showTree); rfb.setCheckDelay(checkDelay); + rfb.setAddSerialNum(addSerialNum); rfb.setViewer(this); rfb.setCuiVersion(false); rfb.setHasViewer(true); // this flag will be overwrited after this method. Do we have to set here?
--- a/src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java Sun Oct 12 23:05:47 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java Mon Oct 13 13:16:49 2014 +0900 @@ -29,7 +29,7 @@ public void inhelitClients(ViewerInterface vncProxyService, String hostName); - public void proxyStart(String[] args, int width, int height, boolean showTree, boolean checkDelay); + public void proxyStart(String[] args, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum); public void setNoConnection(boolean noConnection);