Mercurial > hg > Members > nobuyasu > tightVNCProxy
view src/myVncProxy/CreateThread.java @ 63:4864a7d1df00
add CreateThread.java modify acceptClient.java and VncProxyService.java
author | Yu Taninari <e085734@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 12 Jul 2011 13:47:32 +0900 |
parents | |
children | 3ec4c9e94462 |
line wrap: on
line source
package myVncProxy; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintStream; import java.net.ServerSocket; import java.net.Socket; public class CreateThread extends Thread { String args; ServerSocket echoServer; acceptClient acceptClient; public CreateThread(acceptClient _acc){ acceptClient = _acc; } public void run() { while (true) { try { echoServer = new ServerSocket(9999); } catch (IOException e) { System.out.println(e); } try { Socket clientSocket = echoServer.accept(); BufferedReader is = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); PrintStream os = new PrintStream(clientSocket.getOutputStream()); acceptClient.gethost(is,os); } catch (IOException e){ e.printStackTrace(); System.out.println(e); } try { echoServer.close(); } catch (IOException e){ System.out.println(e); } } } }