Mercurial > hg > Members > nobuyasu > tightVNCProxy
view src/myVncProxy/CreateThread.java @ 129:0571d955da35
print connection speed.
author | e085711 |
---|---|
date | Thu, 04 Aug 2011 15:11:30 +0900 |
parents | 6fc4272db7e2 |
children | e166c3cad2b8 7d9e9dfd7eb8 |
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 implements Runnable { 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); } } } }