diff src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java @ 241:b21a7842a41d

add option addSerialNum.
author oc
date Mon, 13 Oct 2014 13:16:49 +0900
parents 7310e7d7a45f
children a640cd7001e1
line wrap: on
line diff
--- 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