annotate src/treeVnc/WaitReply.java @ 62:b2492abdae2a Version1.0 tip

Added tag TreeVNC_version1.0 for changeset 318ec7415073
author Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
date Sun, 12 Aug 2012 22:13:39 +0900
parents 24112133a0d9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 package treeVnc;
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 import java.net.*;
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 import java.io.*;
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 public class WaitReply extends Thread {
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 // MyVncClient client;
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 InterfaceForViewer client;
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 private String treenum;
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 boolean passflag;
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 /*
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 * public WaitReply(String treenum,MyVncClient client) { this.client =
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 * client; this.treenum = treenum; }
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 */
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 public WaitReply(String treenum, InterfaceForViewer client) {
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 this.client = client;
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 this.treenum = treenum;
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 }
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 public boolean checkPath() {
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 return passflag;
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 }
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 public void run() {
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 Socket clientSocket = null;
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 ServerSocket echoServer = null;
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 // boolean mainFlag;
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 while (true) {
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 try {
22
24112133a0d9 add conf.txt src/treeVnc/ConfFileReader.java
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
34 //echoServer = new ServerSocket(10001 + Integer.parseInt(treenum));
24112133a0d9 add conf.txt src/treeVnc/ConfFileReader.java
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
35 echoServer = new ServerSocket(10001);
15
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 clientSocket = echoServer.accept();
22
24112133a0d9 add conf.txt src/treeVnc/ConfFileReader.java
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
37
15
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 if (clientSocket != null) {
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 client.close();
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 passflag = true;
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 // client.clientSocket = clientSocket;
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 client.setClientSocket(clientSocket);
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 client.init();
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 client.setEchoValue(null);
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 client.getParentName();
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 client.start_threads();
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 client.start();
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 // MyVncClient.main(clientSocket);
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 // echo.Interruption(clientSocket);
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 echoServer.close();
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 }
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 } catch (IOException e) {
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 System.out.println(e);
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 }
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 /*
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 * try { Thread.sleep(100); } catch (InterruptedException e) {
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 * e.printStackTrace(); }
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 */
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 }
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 }
578ea14c95e9 merge treeVnc
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 }