24
|
1 package myVncProxy;
|
65
|
2
|
10
|
3 import java.net.Socket;
|
|
4 import java.io.IOException;
|
43
|
5 import java.io.InputStream;
|
|
6 import java.io.OutputStream;
|
10
|
7
|
|
8 public class acceptThread implements Runnable {
|
|
9 MyRfbProto rfb;
|
25
|
10 byte[] imageBytes;
|
27
|
11
|
65
|
12 acceptThread(MyRfbProto _rfb) {
|
10
|
13 rfb = _rfb;
|
|
14 }
|
65
|
15
|
10
|
16 public void run() {
|
23
|
17 rfb.selectPort();
|
10
|
18 while (true) {
|
|
19 try {
|
|
20 Socket newCli = rfb.accept();
|
65
|
21
|
43
|
22 OutputStream os = newCli.getOutputStream();
|
|
23 InputStream is = newCli.getInputStream();
|
54
|
24 rfb.newClient(this, newCli, os, is);
|
65
|
25 } catch (IOException e) {
|
25
|
26 e.printStackTrace();
|
|
27 System.out.println(e);
|
10
|
28 }
|
|
29 }
|
|
30 }
|
|
31 }
|