Mercurial > hg > Members > nobuyasu > tightVNCProxy
comparison src/myVncProxy/AcceptThread.java @ 76:347c153f74c7
merge
author | Yu Taninari <e085734@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 28 Jul 2011 17:59:39 +0900 |
parents | 6fc4272db7e2 bf5ac06df675 |
children | 712a047908df |
comparison
equal
deleted
inserted
replaced
75:6e703f1000e7 | 76:347c153f74c7 |
---|---|
1 package myVncProxy; | 1 package myVncProxy; |
2 import java.net.ServerSocket; | |
3 import java.net.Socket; | 2 import java.net.Socket; |
4 import java.io.IOException; | 3 import java.io.IOException; |
5 import java.io.InputStream; | 4 import java.io.InputStream; |
6 import java.io.OutputStream; | 5 import java.io.OutputStream; |
7 | 6 |
8 public class AcceptThread implements Runnable { | 7 public class AcceptThread implements Runnable { |
9 MyRfbProto rfb; | 8 MyRfbProto rfb; |
10 byte[] imageBytes; | 9 byte[] imageBytes; |
11 | 10 |
12 AcceptThread(MyRfbProto _rfb ) { | 11 AcceptThread(MyRfbProto _rfb) { |
13 rfb = _rfb; | 12 rfb = _rfb; |
14 } | 13 } |
15 public void run() { | 14 |
16 rfb.selectPort(); | 15 public void run() { |
17 while (true) { | 16 rfb.selectPort(); |
18 try { | 17 while (true) { |
19 Socket newCli = rfb.accept(); | 18 try { |
20 | 19 Socket newCli = rfb.accept(); |
21 OutputStream os = newCli.getOutputStream(); | 20 |
22 InputStream is = newCli.getInputStream(); | 21 OutputStream os = newCli.getOutputStream(); |
23 rfb.newClient(this, newCli, os, is); | 22 InputStream is = newCli.getInputStream(); |
24 } catch (IOException e) { | 23 rfb.newClient(this, newCli, os, is); |
25 e.printStackTrace(); | 24 } catch (IOException e) { |
26 System.out.println(e); | 25 e.printStackTrace(); |
27 } | 26 System.out.println(e); |
28 } | 27 } |
29 } | 28 } |
29 } | |
30 } | 30 } |
31 |