comparison src/main/java/jp/ac/u_ryukyu/treevnc/client/WaitReply.java @ 36:b7d4d0349f99

write part of reconnection and remove warning.
author one
date Tue, 18 Sep 2012 17:23:19 +0900
parents 1b81deb0abb3
children c2f0b6907448
comparison
equal deleted inserted replaced
35:1b81deb0abb3 36:b7d4d0349f99
2 2
3 import java.io.IOException; 3 import java.io.IOException;
4 import java.net.ServerSocket; 4 import java.net.ServerSocket;
5 import java.net.Socket; 5 import java.net.Socket;
6 6
7
8 public class WaitReply extends Thread { 7 public class WaitReply extends Thread {
9 MyVncClient client;
10 boolean passflag; 8 boolean passflag;
9 EchoClient echo;
11 10
12 11 public WaitReply(String treenum, EchoClient echo) {
13 12 this.echo = echo;
14 public WaitReply(String treenum, MyVncClient client) {
15 this.client = client;
16 } 13 }
17 14
18 public boolean checkPath() { 15 public boolean checkPath() {
19 return passflag; 16 return passflag;
20 } 17 }
25 22
26 while (true) { 23 while (true) {
27 try { 24 try {
28 echoServer = new ServerSocket(10001); 25 echoServer = new ServerSocket(10001);
29 clientSocket = echoServer.accept(); 26 clientSocket = echoServer.accept();
30
31 if (clientSocket != null) { 27 if (clientSocket != null) {
32 client.close(); 28 echo.client.close();
33 /*
34 passflag = true; 29 passflag = true;
35 client.setClientSocket(clientSocket); 30 echo.client.setSocket(echo.createSocketForClient(clientSocket));
36 client.init(); 31 // client.init();
37 client.setEchoValue(null); 32 echo.client.run();
38 client.getParentName();
39 client.start_threads();
40 client.start();
41 */
42 client.run();
43 echoServer.close(); 33 echoServer.close();
44 } 34 }
45
46 } catch (IOException e) { 35 } catch (IOException e) {
47 System.out.println(e); 36 System.out.println(e);
48 } 37 }
49 } 38 }
50 } 39 }