view src/main/java/jp/ac/u_ryukyu/treevnc/client/WaitReply.java @ 28:18fad65bc447

Create MyRfbProto.java MyRfbProto.java is a summary of the intersection of MyRfbClient and MyRfbProxy.
author one
date Sat, 01 Sep 2012 19:24:07 +0900
parents 12c3a73be47f
children 1b81deb0abb3
line wrap: on
line source

package jp.ac.u_ryukyu.treevnc.client;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

import jp.ac.u_ryukyu.treevnc.*;


public class WaitReply extends Thread {
	InterfaceForViewer client;
	boolean passflag;
	


	public WaitReply(String treenum, InterfaceForViewer client) {
		this.client = client;
	}
	
	public boolean checkPath() {
		return passflag;
	}
	
	public void run() {
		Socket clientSocket = null;
		ServerSocket echoServer = null;

		while (true) {
			try {
				echoServer = new ServerSocket(10001);
				clientSocket = echoServer.accept();
				
				if (clientSocket != null) {
					client.close();
					/*
					passflag = true;
					client.setClientSocket(clientSocket);
					client.init();
					client.setEchoValue(null);
					client.getParentName();
					client.start_threads();
					client.start();
					*/
					client.run();
					echoServer.close();
				}

			} catch (IOException e) {
				System.out.println(e);
			}
		}
	}
}