Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 235:15e66adbb8bb
get checkdelay nodeNum.
author | oc |
---|---|
date | Sat, 11 Oct 2014 03:18:26 +0900 |
parents | 8479ad028ec7 |
children | 49762c621bd6 |
files | src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java |
diffstat | 1 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Sat Oct 11 02:47:17 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Sat Oct 11 03:18:26 2014 +0900 @@ -179,7 +179,7 @@ byte[] byteAddress = new byte[addressLength]; buf.get(byteAddress); String address = new String(byteAddress, "UTF-8"); - + int nodeNum = getNodeNum(port, address); Long delay = System.currentTimeMillis() - time; System.out.println("delay = " + delay); } @@ -759,17 +759,18 @@ showTreeNode = showTree; } - public int getNodeNum(int port, String hostname, String localhostname) { + public int getNodeNum(int port, String address) { int nodeNum = 0; - - - + for (Iterator<TreeVNCNode> i = nodeList.iterator(); i.hasNext();) { TreeVNCNode tvn = (TreeVNCNode)i.next(); - System.out.println("port = " + tvn.port + ", hostname = " + tvn.hostname + ", localhostname = " + tvn.localhostname + ", nodeNumber" + tvn.treeNum); + System.out.println("checkdelay : port = " + port + ", hostname = " + address); + System.out.println("nodeList : port = " + tvn.port + ", hostname = " + tvn.hostname + ", nodeNumber" + tvn.treeNum); + if (port == tvn.port && address.equals(tvn.hostname)) { + nodeNum = tvn.treeNum; + return nodeNum; + } } - return nodeNum; - } }