Mercurial > hg > Applications > TightVNC_orginal
comparison src/main/java/ac/ryukyu/treevnc/server/AcceptThread.java @ 11:57ae9fbb1245
add files
author | Taninari YU <you@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 21 Aug 2012 14:02:05 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
10:73abb3b86ce7 | 11:57ae9fbb1245 |
---|---|
1 package ac.ryukyu.treevnc.server; | |
2 import java.net.Socket; | |
3 import java.io.IOException; | |
4 import java.io.InputStream; | |
5 import java.io.OutputStream; | |
6 | |
7 public class AcceptThread implements Runnable { | |
8 MyRfbProto rfb = null; | |
9 byte[] imageBytes; | |
10 int port; | |
11 | |
12 AcceptThread(MyRfbProto _rfb) { | |
13 rfb = _rfb; | |
14 } | |
15 | |
16 | |
17 AcceptThread(MyRfbProto _rfb, int p) { | |
18 rfb = _rfb; | |
19 port = p; | |
20 } | |
21 | |
22 public void changeRfb(MyRfbProto _rfb) { | |
23 rfb = _rfb; | |
24 } | |
25 | |
26 public void run() { | |
27 rfb.selectPort(port); | |
28 | |
29 while (true) { | |
30 try { | |
31 Socket newCli = rfb.accept(); | |
32 | |
33 OutputStream os = newCli.getOutputStream(); | |
34 InputStream is = newCli.getInputStream(); | |
35 rfb.newClient(this, newCli, os, is); | |
36 } catch (IOException e) { | |
37 e.printStackTrace(); | |
38 System.out.println(e); | |
39 } | |
40 } | |
41 } | |
42 } |