Mercurial > hg > Applications > AliceVNC
annotate src/main/java/jp/ac/u_ryukyu/alicevnc/NegotiateVNCServer.java @ 55:fe627049e289
update maven added compressed to DSM name
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 16 Nov 2015 20:06:13 +0900 |
parents | 57ca704f86a3 |
children |
rev | line source |
---|---|
7 | 1 package jp.ac.u_ryukyu.alicevnc; |
2 | |
24 | 3 import java.util.ArrayList; |
4 | |
32 | 5 import jp.ac.u_ryukyu.alicevnc.AliceVNCMessage.MessageType; |
24 | 6 |
7 | 7 import com.glavsoft.viewer.Viewer; |
8 | |
9 import alice.codesegment.CodeSegment; | |
10 import alice.datasegment.CommandType; | |
11 import alice.datasegment.Receiver; | |
12 | |
20 | 13 public class NegotiateVNCServer extends CodeSegment { |
7 | 14 private Receiver info = ids.create(CommandType.PEEK); |
20 | 15 private Receiver info1 = ids.create(CommandType.PEEK); |
7 | 16 |
52
57ca704f86a3
back version Alice tag:work-compressedDSM
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
47
diff
changeset
|
17 public NegotiateVNCServer(){ |
55
fe627049e289
update maven added compressed to DSM name
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
52
diff
changeset
|
18 info.setKey("compressedLocal","host"); |
fe627049e289
update maven added compressed to DSM name
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
52
diff
changeset
|
19 info1.setKey("compressedLocal","AliceVNCConfig"); |
7 | 20 } |
22 | 21 |
20 | 22 @Override |
7 | 23 public void run() { |
20 | 24 AliceVNCConfig conf = info1.asClass(AliceVNCConfig.class); |
25 String hostname = info.asString(); | |
22 | 26 |
31 | 27 // root node connect to vnc Server first time. |
28 String[] args = {"localhost"}; | |
29 // negotiate VNCServer by Viewer | |
30 Viewer.main(args); | |
24 | 31 |
31 | 32 // currentServer Info |
32 | 33 AliceVNCMessage currentServerInfo = new AliceVNCMessage(MessageType.CurrentVNCInfo); |
31 | 34 currentServerInfo.name = hostname; |
35 currentServerInfo.allowChange = conf.getAllowChange(); | |
36 ArrayList<String> list = new ArrayList<String>(); | |
37 currentServerInfo.route = list; | |
34 | 38 ods.put("AliceVNCMessage", currentServerInfo); |
30 | 39 |
7 | 40 } |
41 | |
42 } |