Mercurial > hg > Members > nobuyasu > tightVNCProxy
annotate src/myVncProxy/AcceptThread.java @ 166:3c055da4d050
add authenticate AuthAccess
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 Oct 2011 19:50:30 +0900 |
parents | df68f1f9034d |
children | 134deb9f8148 |
rev | line source |
---|---|
118 | 1 package myVncProxy; |
70
c92ec7258953
change name AcceptThread
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 import java.net.Socket; |
71 | 3 import java.io.IOException; |
4 import java.io.InputStream; | |
5 import java.io.OutputStream; | |
70
c92ec7258953
change name AcceptThread
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 |
71 | 7 public class AcceptThread implements Runnable { |
8 MyRfbProto rfb; | |
9 byte[] imageBytes; | |
80 | 10 int port; |
11 | |
71 | 12 AcceptThread(MyRfbProto _rfb) { |
13 rfb = _rfb; | |
14 } | |
70
c92ec7258953
change name AcceptThread
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 |
80 | 16 AcceptThread(MyRfbProto _rfb, int p) { |
17 rfb = _rfb; | |
18 port = p; | |
19 } | |
20 | |
71 | 21 public void run() { |
80 | 22 rfb.selectPort(port); |
71 | 23 while (true) { |
24 try { | |
25 Socket newCli = rfb.accept(); | |
70
c92ec7258953
change name AcceptThread
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 |
71 | 27 OutputStream os = newCli.getOutputStream(); |
28 InputStream is = newCli.getInputStream(); | |
29 rfb.newClient(this, newCli, os, is); | |
30 } catch (IOException e) { | |
31 e.printStackTrace(); | |
32 System.out.println(e); | |
33 } | |
34 } | |
35 } | |
73 | 36 } |