comparison src/myVncClient/EchoClient.java @ 74:7d25b08f5835

modify CuiMyVncClient
author e085711
date Tue, 30 Aug 2011 16:42:31 +0900
parents 83acdeca0539
children c76e43a12796
comparison
equal deleted inserted replaced
73:83acdeca0539 74:7d25b08f5835
26 // WaitReplyに自分自身を渡している 26 // WaitReplyに自分自身を渡している
27 public EchoClient() { 27 public EchoClient() {
28 } 28 }
29 29
30 // VncViewerから引数をもらってきてproxy役を認識する 30 // VncViewerから引数をもらってきてproxy役を認識する
31 public EchoClient(String _name,MyVncClient client) { 31 public EchoClient(String name,MyVncClient client) {
32 this.client = client; 32 this.client = client;
33 name = _name; 33 this.name = name;
34 } 34 }
35 35
36 public EchoClient(String _name,MyVncClient client, int echoPort) { 36 public EchoClient(String name,MyVncClient client, int echoPort) {
37 this.client = client; 37 this.client = client;
38 name = _name; 38 this.name = name;
39 this.echoPort = echoPort; 39 this.echoPort = echoPort;
40 } 40 }
41 41
42
43 public EchoClient(EchoClient echo,MyVncClient client) { 42 public EchoClient(EchoClient echo,MyVncClient client) {
44 this.client = client; 43 this.client = client;
45 name = echo.name; 44 this.name = echo.name;
46 leaderflag = echo.leaderflag; 45 leaderflag = echo.leaderflag;
47 parent = echo.parent; 46 parent = echo.parent;
48 treenum = echo.treenum; 47 treenum = echo.treenum;
49 } 48 }
50 49
51 public EchoClient(String _name,CuiMyVncClient client) { 50 public EchoClient(String name,CuiMyVncClient client) {
52 this.client = client; 51 this.client = client;
53 name = _name; 52 this.name = name;
54 } 53 }
55 54
55 public EchoClient(String name,CuiMyVncClient client, int echoPort) {
56 this.client = client;
57 this.name = name;
58 this.echoPort = echoPort;
59 }
60
56 public EchoClient(EchoClient echo,CuiMyVncClient client) { 61 public EchoClient(EchoClient echo,CuiMyVncClient client) {
57 this.client = client; 62 this.client = client;
58 name = echo.name; 63 this.name = echo.name;
59 leaderflag = echo.leaderflag; 64 leaderflag = echo.leaderflag;
60 parent = echo.parent; 65 parent = echo.parent;
61 treenum = echo.treenum; 66 treenum = echo.treenum;
62 } 67 }
63 68
64
65 // void hostn(String args){ 69 // void hostn(String args){
66 void openport() { 70 void openport() {
67 //  ソケットや入出力用のストリームの宣言 71 //  ソケットや入出力用のストリームの宣言
68 /* 72 /*
69 Random rnd = new Random(); 73 Random rnd = new Random();
169 /** 173 /**
170 * if ((value.treenum = is.readLine()) != null) { 174 * if ((value.treenum = is.readLine()) != null) {
171 * System.out.println("treenum: " + value.treenum); } 175 * System.out.println("treenum: " + value.treenum); }
172 */ 176 */
173 Thread.sleep(1000); 177 Thread.sleep(1000);
174 client.init(this); 178 client.init();
175 client.start_threads(); 179 client.start_threads();
176 client.start(); 180 client.start();
177 // MyVncClient.main(this); 181 // MyVncClient.main(this);
178 182
179 // 開いたソケットなどをクローズ 183 // 開いたソケットなどをクローズ
233 System.out.println("Server: " + treenum); 237 System.out.println("Server: " + treenum);
234 } 238 }
235 if ((leaderflag = is.readLine()) != null) { 239 if ((leaderflag = is.readLine()) != null) {
236 System.out.println("parent: " + leaderflag); 240 System.out.println("parent: " + leaderflag);
237 } 241 }
238 client.init(this); 242 client.init();
239 client.start_threads(); 243 client.start_threads();
240 client.start(); 244 client.start();
241 os.close(); 245 os.close();
242 is.close(); 246 is.close();
243 echoSocket.close(); 247 echoSocket.close();