Mercurial > hg > Members > you > TreeVNC
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 |
rev | line source |
---|---|
15 | 1 package treeVnc; |
2 | |
3 import java.net.*; | |
4 import java.io.*; | |
5 | |
6 public class WaitReply extends Thread { | |
7 // MyVncClient client; | |
8 InterfaceForViewer client; | |
9 private String treenum; | |
10 boolean passflag; | |
11 | |
12 | |
13 /* | |
14 * public WaitReply(String treenum,MyVncClient client) { this.client = | |
15 * client; this.treenum = treenum; } | |
16 */ | |
17 | |
18 public WaitReply(String treenum, InterfaceForViewer client) { | |
19 this.client = client; | |
20 this.treenum = treenum; | |
21 } | |
22 | |
23 public boolean checkPath() { | |
24 return passflag; | |
25 } | |
26 | |
27 public void run() { | |
28 Socket clientSocket = null; | |
29 ServerSocket echoServer = null; | |
30 // boolean mainFlag; | |
31 | |
32 while (true) { | |
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 | 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 | 38 if (clientSocket != null) { |
39 client.close(); | |
40 passflag = true; | |
41 // client.clientSocket = clientSocket; | |
42 client.setClientSocket(clientSocket); | |
43 client.init(); | |
44 client.setEchoValue(null); | |
45 client.getParentName(); | |
46 client.start_threads(); | |
47 client.start(); | |
48 // MyVncClient.main(clientSocket); | |
49 // echo.Interruption(clientSocket); | |
50 echoServer.close(); | |
51 } | |
52 | |
53 } catch (IOException e) { | |
54 System.out.println(e); | |
55 } | |
56 /* | |
57 * try { Thread.sleep(100); } catch (InterruptedException e) { | |
58 * e.printStackTrace(); } | |
59 */ | |
60 } | |
61 } | |
62 } |