Mercurial > hg > Members > nobuyasu > tightVNCClient
view src/myVncClient/WaitReply.java @ 85:ba6e672cc47c
update EchoClient.java
author | Yu Taninari <you@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 06 Sep 2011 06:20:47 +0900 |
parents | 3bfe8845684c |
children | 1d1bb77d871b 961a5915834f |
line wrap: on
line source
package myVncClient; 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 void run() { Socket clientSocket = null; ServerSocket echoServer = null; // boolean mainFlag; while (true) { try { echoServer = new ServerSocket(10001 + Integer.parseInt(treenum)); } catch (IOException e) { System.out.println(e); } try { clientSocket = echoServer.accept(); if (clientSocket != null) { client.close(); // client.clientSocket = clientSocket; client.setClientSocket(clientSocket); client.init(); passflag = true; 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(); } */ } } }