# HG changeset patch # User Yu Taninari # Date 1311927827 -32400 # Node ID e65934744da861dfd2dce0abf41b53e92ed6ebb5 # Parent 9f8463fb1d4d54d60fe487dfb1c4825cc3c3907a update diff -r 9f8463fb1d4d -r e65934744da8 VncViewer.jar Binary file VncViewer.jar has changed diff -r 9f8463fb1d4d -r e65934744da8 myVncClient.jar Binary file myVncClient.jar has changed diff -r 9f8463fb1d4d -r e65934744da8 src/myVncClient/EchoClient.java --- a/src/myVncClient/EchoClient.java Thu Jul 28 18:07:21 2011 +0900 +++ b/src/myVncClient/EchoClient.java Fri Jul 29 17:23:47 2011 +0900 @@ -119,6 +119,7 @@ * Call at lost host */ boolean losthost() { + String checkRepetition; if (echoSocket != null && os != null && is != null) { try { if(runflag){ @@ -126,9 +127,9 @@ } // echoSocketの情報を呼び出す if ("1".equals(leaderflag)) { - senddataProxy("1",parent); + senddataProxy("1",parent,treenum); } else { - senddataProxy("3",parent); + senddataProxy("3",parent,treenum); } if ((responseLine = is.readLine()) != null) { @@ -137,8 +138,12 @@ if ((parent = is.readLine()) != null) { System.out.println("parent: " + parent); } - - + if ((checkRepetition = is.readLine()) != null) { + System.out.println("checkRepetition: " + checkRepetition); + } + if(checkRepetition.equals("stop")){ + return true; + } /** * if ((value.treenum = is.readLine()) != null) { @@ -195,7 +200,7 @@ if (echoSocket != null && os != null && is != null) { runflag = true; try { - senddataProxy("2", parent); + senddataProxy("2", parent,null); if ((responseLine = is.readLine()) != null) { System.out.println("Server: " + responseLine); @@ -292,10 +297,16 @@ return this; } - void senddataProxy(String type,String num) { + void senddataProxy(String type,String num,String treenum) { try { - os.writeBytes(type + "\n"); - os.writeBytes(num + "\n"); + if(treenum!=null) { + os.writeBytes(type + "\n"); + os.writeBytes(num + "\n"); + os.writeBytes(treenum + "\n"); + } else { + os.writeBytes(type + "\n"); + os.writeBytes(num + "\n"); + } } catch (UnknownHostException e) { System.err.println("Trying to connect to unknown host: " + e);