Mercurial > hg > Members > nobuyasu > tightVNCClient
comparison src/myVncClient/WaitReply.java @ 60:18a19d8a09f4
add some files. for to use Client with CUI.
author | e085711 |
---|---|
date | Fri, 05 Aug 2011 01:05:38 +0900 |
parents | f2f4b0398f04 |
children | f6cb1edc2036 |
comparison
equal
deleted
inserted
replaced
59:d086ec1b4a7a | 60:18a19d8a09f4 |
---|---|
3 import java.net.*; | 3 import java.net.*; |
4 import java.io.*; | 4 import java.io.*; |
5 | 5 |
6 | 6 |
7 public class WaitReply extends Thread { | 7 public class WaitReply extends Thread { |
8 MyVncClient client; | 8 // MyVncClient client; |
9 InterfaceForViewer client; | |
9 private String treenum; | 10 private String treenum; |
10 | 11 |
12 | |
13 /* | |
11 public WaitReply(String treenum,MyVncClient client) { | 14 public WaitReply(String treenum,MyVncClient client) { |
12 this.client = client; | 15 this.client = client; |
13 this.treenum = treenum; | 16 this.treenum = treenum; |
14 } | 17 } |
18 */ | |
15 | 19 |
20 public WaitReply(String treenum,InterfaceForViewer client) { | |
21 this.client = client; | |
22 this.treenum = treenum; | |
23 } | |
24 | |
25 | |
16 public void run(){ | 26 public void run(){ |
17 Socket clientSocket = null; | 27 Socket clientSocket = null; |
18 ServerSocket echoServer=null; | 28 ServerSocket echoServer=null; |
19 //boolean mainFlag; | 29 //boolean mainFlag; |
20 | 30 |
22 try { | 32 try { |
23 echoServer = new ServerSocket(10001 + Integer.parseInt(treenum)); | 33 echoServer = new ServerSocket(10001 + Integer.parseInt(treenum)); |
24 } | 34 } |
25 catch (IOException e) { | 35 catch (IOException e) { |
26 System.out.println(e); | 36 System.out.println(e); |
27 } | 37 } |
28 try { | 38 try { |
29 clientSocket = echoServer.accept(); | 39 clientSocket = echoServer.accept(); |
30 if(clientSocket != null){ | 40 if(clientSocket != null){ |
31 client.clientSocket = clientSocket; | 41 // client.clientSocket = clientSocket; |
42 client.setClientSocket(clientSocket); | |
32 client.init(null); | 43 client.init(null); |
33 client.start_threads(); | 44 client.start_threads(); |
34 client.start(); | 45 client.start(); |
35 //MyVncClient.main(clientSocket); | 46 //MyVncClient.main(clientSocket); |
36 //echo.Interruption(clientSocket); | 47 //echo.Interruption(clientSocket); |