Mercurial > hg > Applications > AliceVNC
view src/main/java/jp/ac/u_ryukyu/alicevnc/NegotiateVNCServer.java @ 31:556e27a53219
refactor and bug fix
author | sugi |
---|---|
date | Sat, 08 Nov 2014 23:11:45 +0900 |
parents | d8c6a4c7f16e |
children | 7d65ad341cc9 |
line wrap: on
line source
package jp.ac.u_ryukyu.alicevnc; import java.util.ArrayList; import jp.ac.u_ryukyu.alicevnc.ChangeRequestMessage.MessageType; import com.glavsoft.viewer.Viewer; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; public class NegotiateVNCServer extends CodeSegment { private Receiver info = ids.create(CommandType.PEEK); private Receiver info1 = ids.create(CommandType.PEEK); public NegotiateVNCServer(){ info.setKey("host"); info1.setKey("AliceVNCConfig"); } @Override public void run() { AliceVNCConfig conf = info1.asClass(AliceVNCConfig.class); String hostname = info.asString(); // root node connect to vnc Server first time. String[] args = {"localhost"}; // negotiate VNCServer by Viewer Viewer.main(args); // currentServer Info ChangeRequestMessage currentServerInfo = new ChangeRequestMessage(MessageType.CurrentVNCInfo); currentServerInfo.name = hostname; currentServerInfo.allowChange = conf.getAllowChange(); ArrayList<String> list = new ArrayList<String>(); currentServerInfo.route = list; ods.put("changeRequest", currentServerInfo); } }