Mercurial > hg > Members > you > TreeVNC
view 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 (2012-08-12) |
parents | 24112133a0d9 |
children |
line wrap: on
line source
package treeVnc; import java.net.*; import java.io.*; public class WaitReply extends Thread { // MyVncClient client; InterfaceForViewer client; private String treenum; boolean passflag; /* * public WaitReply(String treenum,MyVncClient client) { this.client = * client; this.treenum = treenum; } */ public WaitReply(String treenum, InterfaceForViewer client) { this.client = client; this.treenum = treenum; } public boolean checkPath() { return passflag; } public void run() { Socket clientSocket = null; ServerSocket echoServer = null; // boolean mainFlag; while (true) { try { //echoServer = new ServerSocket(10001 + Integer.parseInt(treenum)); echoServer = new ServerSocket(10001); clientSocket = echoServer.accept(); if (clientSocket != null) { client.close(); passflag = true; // client.clientSocket = clientSocket; client.setClientSocket(clientSocket); client.init(); client.setEchoValue(null); client.getParentName(); client.start_threads(); client.start(); // MyVncClient.main(clientSocket); // echo.Interruption(clientSocket); echoServer.close(); } } catch (IOException e) { System.out.println(e); } /* * try { Thread.sleep(100); } catch (InterruptedException e) { * e.printStackTrace(); } */ } } }