17
|
1 package myVncClient;
|
10
|
2 import java.net.Socket;
|
|
3 import java.io.IOException;
|
27
|
4 import java.io.InputStream;
|
|
5 import java.io.OutputStream;
|
17
|
6
|
10
|
7 public class acceptThread implements Runnable {
|
|
8 MyRfbProto rfb;
|
27
|
9 byte[] imageBytes;
|
10
|
10
|
27
|
11 acceptThread(MyRfbProto _rfb ) {
|
10
|
12 rfb = _rfb;
|
|
13 }
|
|
14 public void run() {
|
18
|
15 rfb.selectPort();
|
10
|
16 while (true) {
|
|
17 try {
|
|
18 Socket newCli = rfb.accept();
|
27
|
19 OutputStream os = newCli.getOutputStream();
|
|
20 InputStream is = newCli.getInputStream();
|
|
21 rfb.sendRfbVersion(os);
|
28
|
22 rfb.readVersionMsg(is);
|
27
|
23 rfb.sendSecurityType(os);
|
28
|
24 rfb.readSecType(is);
|
|
25 rfb.sendSecResult(os);
|
27
|
26 rfb.readClientInit(is);
|
|
27 rfb.sendInitData(os);
|
19
|
28 rfb.createBimgFlag = true;
|
27
|
29 // rfb.addSockTmp(newCli);
|
|
30 rfb.addSock(newCli);
|
10
|
31 } catch (IOException e) {
|
19
|
32 e.printStackTrace();
|
|
33 System.out.println(e);
|
10
|
34 }
|
|
35 }
|
|
36 }
|
27
|
37 }
|