view src/myVncClient/waitreply.java @ 30:a335a1038a23

merge taninari's program
author e085711
date Wed, 06 Jul 2011 12:30:17 +0900
parents 750ecaa1e1b9
children 76f5994f2af2
line wrap: on
line source

package myVncClient;

import java.net.*;
import java.io.*;


public class waitreply extends Thread {
	echoClient echo;
	Socket clientSocket = null;
	ServerSocket echoServer=null;

	
	waitreply(echoClient _echo){
		echo = _echo;
	}
	
	public void run(){
		
		while(true){
			try {
				echoServer = new ServerSocket(10001 + Integer.parseInt(echoClient.value.treenum));
			}
			catch (IOException e) {
				System.out.println(e);
			}                                                                                                                
			try {
			clientSocket = echoServer.accept();
			if(clientSocket != null){
				MyVncClient.main(clientSocket);
				//echo.Interruption(clientSocket);
			}
			}catch (IOException e){
				System.out.println(e);
			}
			/*
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			*/
		}
	}
}