Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 506:3fe7e1a372df
Multicast CUI
author | toubaru |
---|---|
date | Tue, 19 Feb 2019 15:59:50 +0900 |
parents | af958194248b |
children | 89f1f7e41838 |
files | .idea/modules.xml Todo.txt WifiBroadCast.mm doc/WifiBroadCast.mm src/main/java/jp/ac/u_ryukyu/treevnc/TreeRootFinderListener.java src/viewer_swing/java/com/glavsoft/viewer/ConnectionPresenter.java src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java src/viewer_swing/java/com/glavsoft/viewer/Viewer.java |
diffstat | 8 files changed, 102 insertions(+), 78 deletions(-) [+] |
line wrap: on
line diff
--- a/.idea/modules.xml Mon Feb 18 18:46:23 2019 +0900 +++ b/.idea/modules.xml Tue Feb 19 15:59:50 2019 +0900 @@ -2,7 +2,6 @@ <project version="4"> <component name="ProjectModuleManager"> <modules> - <module fileurl="file://$PROJECT_DIR$/TreeVNC.iml" filepath="$PROJECT_DIR$/TreeVNC.iml" /> <module fileurl="file://$PROJECT_DIR$/.idea/modules/TreeVNC_main.iml" filepath="$PROJECT_DIR$/.idea/modules/TreeVNC_main.iml" group="TreeVNC" /> <module fileurl="file://$PROJECT_DIR$/.idea/modules/TreeVNC_test.iml" filepath="$PROJECT_DIR$/.idea/modules/TreeVNC_test.iml" group="TreeVNC" /> <module fileurl="file://$PROJECT_DIR$/.idea/modules/TreeVNC_viewerSwing.iml" filepath="$PROJECT_DIR$/.idea/modules/TreeVNC_viewerSwing.iml" group="TreeVNC" />
--- a/Todo.txt Mon Feb 18 18:46:23 2019 +0900 +++ b/Todo.txt Tue Feb 19 15:59:50 2019 +0900 @@ -1,3 +1,11 @@ +Tue Feb 19 15:01:43 JST 2019 + マルチキャスト用のパラメーター + Packet size + Multicast Address + IPv6, IPv4 + Command line + + Wed Jan 30 18:55:55 JST 2019 directconnection 時に nodeid を正しく設定する必要がある
--- a/WifiBroadCast.mm Mon Feb 18 18:46:23 2019 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -<map version="0.9.0"> -<!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net --> -<node CREATED="1375862208091" ID="ID_1435980750" MODIFIED="1375862329668" TEXT="WifiBroadCast"> -<node CREATED="1375862227074" ID="ID_1671888494" MODIFIED="1375862235198" POSITION="right" TEXT="実験の目的"> -<node CREATED="1375862255760" ID="ID_159564438" MODIFIED="1375862324968" TEXT="TreeVNCにMulticastが使用できるかどうかを調べる"/> -</node> -<node CREATED="1375862332655" ID="ID_675436470" MODIFIED="1375862894097" POSITION="left" TEXT="実験規模"> -<node CREATED="1375862337823" ID="ID_1026201136" MODIFIED="1375862805948" TEXT="無線ステーション(802.11a/g/b))"> -<node CREATED="1375862792648" ID="ID_1054538330" MODIFIED="1375862800938" TEXT="AirStation"/> -<node CREATED="1375862807503" ID="ID_1441557306" MODIFIED="1375862824694" TEXT="AirMacStation"/> -</node> -<node CREATED="1375862422679" ID="ID_187514466" MODIFIED="1375862643954" TEXT="クライアント数"> -<node CREATED="1375862437097" ID="ID_1909771864" MODIFIED="1375862454492" TEXT="iMac"/> -<node CREATED="1375862455240" ID="ID_1182721233" MODIFIED="1375862459019" TEXT="Mac pro"/> -<node CREATED="1375862460975" ID="ID_60013417" MODIFIED="1375862471852" TEXT="Mac mini * 3"/> -<node CREATED="1375862472495" ID="ID_848088782" MODIFIED="1375862483276" TEXT="Mac Book Pro * 10"/> -</node> -<node CREATED="1375862628620" ID="ID_1279234975" MODIFIED="1375862638705" TEXT="目標数"> -<node CREATED="1375862694318" ID="ID_711725119" MODIFIED="1375862773148" TEXT="70(321の学生数)"/> -</node> -<node CREATED="1375862895728" ID="ID_1713124083" MODIFIED="1375862931230" TEXT="電波の状況"> -<node CREATED="1375862964723" ID="ID_248823562" MODIFIED="1375862987663" TEXT="妨害電波のあるなし"/> -<node CREATED="1375863003123" ID="ID_1972998265" MODIFIED="1375863008536" TEXT="トラフィック状況"/> -<node CREATED="1375863024852" ID="ID_1727488162" MODIFIED="1375863121139" TEXT="場所(321と611と406)"/> -</node> -</node> -<node CREATED="1375863131964" ID="ID_497519094" MODIFIED="1375863136962" POSITION="right" TEXT="実験内容"> -<node CREATED="1375863157718" ID="ID_587883160" MODIFIED="1375863216132" TEXT="パケットのサイズ(128byte~512Kbyteまで)"/> -<node CREATED="1375863239656" ID="ID_1702750962" MODIFIED="1375863257171" TEXT="パケットの個数(10~100)"/> -<node CREATED="1375863257798" ID="ID_1454190239" MODIFIED="1375863265065" TEXT="プロトコル"> -<node CREATED="1375863265066" ID="ID_763089742" MODIFIED="1375863272539" TEXT="Broadcast"> -<node CREATED="1375865442473" ID="ID_1358563788" MODIFIED="1375865453726" TEXT="3"/> -</node> -<node CREATED="1375863273327" ID="ID_793864869" MODIFIED="1375865397800" TEXT="Multicast"> -<node CREATED="1375865397801" ID="ID_237048050" MODIFIED="1375865434158" TEXT="1"/> -</node> -<node CREATED="1375863277191" ID="ID_677403240" MODIFIED="1375863279251" TEXT="TCP"> -<node CREATED="1375865422433" ID="ID_649935149" MODIFIED="1375865427182" TEXT="2"/> -</node> -</node> -<node CREATED="1375863294783" ID="ID_339954849" MODIFIED="1375863299829" TEXT="測定"> -<node CREATED="1375863303683" ID="ID_1050197818" MODIFIED="1375863308509" TEXT="パケットロスト率"> -<node CREATED="1375864091904" ID="ID_795745337" MODIFIED="1375864099068" TEXT="PC側"/> -<node CREATED="1375864099471" ID="ID_224074828" MODIFIED="1375864645981" TEXT="Switch側"/> -</node> -<node CREATED="1375863309121" ID="ID_76819691" MODIFIED="1375863345502" TEXT="スループット"/> -<node CREATED="1375864647755" ID="ID_1762535066" MODIFIED="1375864653726" TEXT="バッファの大きさ"/> -</node> -</node> -<node CREATED="1375864918215" ID="ID_1961357787" MODIFIED="1375864933425" POSITION="right" TEXT="TreeVNCの変更"> -<node CREATED="1375864933426" ID="ID_1171105144" MODIFIED="1375865060269" TEXT="Blocking(64K~)"> -<node CREATED="1375865060270" ID="ID_1594748367" MODIFIED="1375865064727" TEXT="速度"/> -<node CREATED="1375865521003" ID="ID_1497362366" MODIFIED="1375865525104" TEXT="並列化"/> -<node CREATED="1375865731959" ID="ID_1664410067" MODIFIED="1375865897884" TEXT="圧縮に互換性のあるアルゴリズムを書く"/> -</node> -</node> -</node> -</map>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/WifiBroadCast.mm Tue Feb 19 15:59:50 2019 +0900 @@ -0,0 +1,58 @@ +<map version="0.9.0"> +<!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net --> +<node CREATED="1375862208091" ID="ID_1435980750" MODIFIED="1375862329668" TEXT="WifiBroadCast"> +<node CREATED="1375862227074" ID="ID_1671888494" MODIFIED="1375862235198" POSITION="right" TEXT="実験の目的"> +<node CREATED="1375862255760" ID="ID_159564438" MODIFIED="1375862324968" TEXT="TreeVNCにMulticastが使用できるかどうかを調べる"/> +</node> +<node CREATED="1375862332655" ID="ID_675436470" MODIFIED="1375862894097" POSITION="left" TEXT="実験規模"> +<node CREATED="1375862337823" ID="ID_1026201136" MODIFIED="1375862805948" TEXT="無線ステーション(802.11a/g/b))"> +<node CREATED="1375862792648" ID="ID_1054538330" MODIFIED="1375862800938" TEXT="AirStation"/> +<node CREATED="1375862807503" ID="ID_1441557306" MODIFIED="1375862824694" TEXT="AirMacStation"/> +</node> +<node CREATED="1375862422679" ID="ID_187514466" MODIFIED="1375862643954" TEXT="クライアント数"> +<node CREATED="1375862437097" ID="ID_1909771864" MODIFIED="1375862454492" TEXT="iMac"/> +<node CREATED="1375862455240" ID="ID_1182721233" MODIFIED="1375862459019" TEXT="Mac pro"/> +<node CREATED="1375862460975" ID="ID_60013417" MODIFIED="1375862471852" TEXT="Mac mini * 3"/> +<node CREATED="1375862472495" ID="ID_848088782" MODIFIED="1375862483276" TEXT="Mac Book Pro * 10"/> +</node> +<node CREATED="1375862628620" ID="ID_1279234975" MODIFIED="1375862638705" TEXT="目標数"> +<node CREATED="1375862694318" ID="ID_711725119" MODIFIED="1375862773148" TEXT="70(321の学生数)"/> +</node> +<node CREATED="1375862895728" ID="ID_1713124083" MODIFIED="1375862931230" TEXT="電波の状況"> +<node CREATED="1375862964723" ID="ID_248823562" MODIFIED="1375862987663" TEXT="妨害電波のあるなし"/> +<node CREATED="1375863003123" ID="ID_1972998265" MODIFIED="1375863008536" TEXT="トラフィック状況"/> +<node CREATED="1375863024852" ID="ID_1727488162" MODIFIED="1375863121139" TEXT="場所(321と611と406)"/> +</node> +</node> +<node CREATED="1375863131964" ID="ID_497519094" MODIFIED="1375863136962" POSITION="right" TEXT="実験内容"> +<node CREATED="1375863157718" ID="ID_587883160" MODIFIED="1375863216132" TEXT="パケットのサイズ(128byte~512Kbyteまで)"/> +<node CREATED="1375863239656" ID="ID_1702750962" MODIFIED="1375863257171" TEXT="パケットの個数(10~100)"/> +<node CREATED="1375863257798" ID="ID_1454190239" MODIFIED="1375863265065" TEXT="プロトコル"> +<node CREATED="1375863265066" ID="ID_763089742" MODIFIED="1375863272539" TEXT="Broadcast"> +<node CREATED="1375865442473" ID="ID_1358563788" MODIFIED="1375865453726" TEXT="3"/> +</node> +<node CREATED="1375863273327" ID="ID_793864869" MODIFIED="1375865397800" TEXT="Multicast"> +<node CREATED="1375865397801" ID="ID_237048050" MODIFIED="1375865434158" TEXT="1"/> +</node> +<node CREATED="1375863277191" ID="ID_677403240" MODIFIED="1375863279251" TEXT="TCP"> +<node CREATED="1375865422433" ID="ID_649935149" MODIFIED="1375865427182" TEXT="2"/> +</node> +</node> +<node CREATED="1375863294783" ID="ID_339954849" MODIFIED="1375863299829" TEXT="測定"> +<node CREATED="1375863303683" ID="ID_1050197818" MODIFIED="1375863308509" TEXT="パケットロスト率"> +<node CREATED="1375864091904" ID="ID_795745337" MODIFIED="1375864099068" TEXT="PC側"/> +<node CREATED="1375864099471" ID="ID_224074828" MODIFIED="1375864645981" TEXT="Switch側"/> +</node> +<node CREATED="1375863309121" ID="ID_76819691" MODIFIED="1375863345502" TEXT="スループット"/> +<node CREATED="1375864647755" ID="ID_1762535066" MODIFIED="1375864653726" TEXT="バッファの大きさ"/> +</node> +</node> +<node CREATED="1375864918215" ID="ID_1961357787" MODIFIED="1375864933425" POSITION="right" TEXT="TreeVNCの変更"> +<node CREATED="1375864933426" ID="ID_1171105144" MODIFIED="1375865060269" TEXT="Blocking(64K~)"> +<node CREATED="1375865060270" ID="ID_1594748367" MODIFIED="1375865064727" TEXT="速度"/> +<node CREATED="1375865521003" ID="ID_1497362366" MODIFIED="1375865525104" TEXT="並列化"/> +<node CREATED="1375865731959" ID="ID_1664410067" MODIFIED="1375865897884" TEXT="圧縮に互換性のあるアルゴリズムを書く"/> +</node> +</node> +</node> +</map>
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRootFinderListener.java Mon Feb 18 18:46:23 2019 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRootFinderListener.java Tue Feb 19 15:59:50 2019 +0900 @@ -23,13 +23,14 @@ private ViewerInterface vps; private MulticastSocket soc; private SecurityManager securityManager; + private boolean isTreeRoot; public TreeRootFinderListener(ViewerInterface vncProxyService) { vps = vncProxyService; + isTreeRoot = vps.getRfb().isTreeManager(); } public TreeRootFinderListener(ViewerInterface vncProxyService, ReceiverTask receiverTask) { - vps = vncProxyService; this.receiverTask = receiverTask; } @@ -64,7 +65,7 @@ String hostname = recvPacket.getAddress().getHostAddress(); byte[] reply = recvPacket.getData(); int len = recvPacket.getLength(); - if (len == 12 && (reply[0] & 0xff) == TreeCommand.FIND_ROOT.cmd) { + if (isTreeRoot && len == 12 && (reply[0] & 0xff) == TreeCommand.FIND_ROOT.cmd) { int port = reply[8]; port = port * 256 + reply[9]; port = port * 256 + reply[10]; @@ -72,12 +73,10 @@ TreeVncProtocol t = new TreeVncProtocol(hostname, port); t.findRootReply(vps.getRfb().getAcceptPort()); - } else { - if (receiverTask != null) { - receiverTask.setReader(new Reader(new ByteArrayInputStream(reply))); - if (receiverTask.getMessageId() == FRAMEBUFFER_UPDATE) { - receiverTask.framebufferUpdateMessage(); - } + } else if (receiverTask != null) { + receiverTask.setReader(new Reader(new ByteArrayInputStream(reply))); + if (receiverTask.getMessageId() == FRAMEBUFFER_UPDATE) { + receiverTask.framebufferUpdateMessage(); } } }
--- a/src/viewer_swing/java/com/glavsoft/viewer/ConnectionPresenter.java Mon Feb 18 18:46:23 2019 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/ConnectionPresenter.java Tue Feb 19 15:59:50 2019 +0900 @@ -64,6 +64,8 @@ private NetworkConnectionWorker networkConnectionWorker; private boolean needReconnection = true; private boolean isTreeVNC = false; + + private boolean useMulticast = false; private boolean cuiVersion; private boolean noConnection = false; public ViewerInterface viewer; @@ -461,4 +463,11 @@ this.singleHeight = signleHeight; } + public void setMulticast(boolean b) { + useMulticast = b; + } + + public boolean isUseMulticast() { + return useMulticast; + } }
--- a/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Mon Feb 18 18:46:23 2019 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Tue Feb 19 15:59:50 2019 +0900 @@ -26,6 +26,7 @@ private boolean logFile = false; private boolean filterSingleDisplay = false; private boolean direct = false; + private boolean useMulticast = false; public static void main(String[] args) throws SocketException, UnknownHostException { @@ -161,6 +162,9 @@ } else if ("--checkDelay".equals(args[i])) { // check flow of data delay. checkDelay = true; + } else if ("--useMulticast".equals(args[i])) { + // check flow of data delay. + useMulticast = true; } else if ("--addSerialNum".equals(args[i])) { // add data serial number. addSerialNum = true; @@ -197,6 +201,7 @@ + "--height h: Set display height.\n" + "--showTree: Show connected tree node.\n" + "--checkDelay: Check speed flow of data each node.\n" + + "--useMulticast: Use Multicast\n" + "--logFile logFileName: Set log file name.\n" + "--fixingSize w h: Fix share screen size.\n" + "--addSerialNum: Check lost data.\n"); @@ -210,6 +215,9 @@ v.setWidth(width); v.setHeight(height); } + if (useMulticast) { + v.getConnectionPresenter().setMulticast(true); + } } public void setFixingSizeDisplay(ViewerInterface v) {
--- a/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Mon Feb 18 18:46:23 2019 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Tue Feb 19 15:59:50 2019 +0900 @@ -350,19 +350,20 @@ private ConnectionPresenter createNewConnectionPresenter(String hostName, short newVNCServerId, int x, int y, int width, int height, int scale) { final boolean hasJsch = checkJsch(); final boolean allowInteractive = allowAppletInteractiveConnections || ! isApplet; - final ConnectionPresenter connectionPresenter = new ConnectionPresenter(hasJsch, allowInteractive); + final ConnectionPresenter connectionPresenter1 = new ConnectionPresenter(hasJsch, allowInteractive); ConnectionParams connectionParams = new ConnectionParams(); connectionParams.setConnectionParam(hostName, vncport); - connectionPresenter.addModel("ConnectionParamsModel", connectionParams); - connectionPresenter.setConnectionParams(connectionParams); - connectionPresenter.setReconnectingId(newVNCServerId); - connectionPresenter.setIsTreeVNC(true); - connectionPresenter.setNoConnection(false); - connectionPresenter.setX(x); - connectionPresenter.setY(y); - connectionPresenter.setSingleWidth(width); - connectionPresenter.setSingleHeight(height); - connectionPresenter.setRetinaScale(scale); + connectionPresenter1.addModel("ConnectionParamsModel", connectionParams); + connectionPresenter1.setConnectionParams(connectionParams); + connectionPresenter1.setReconnectingId(newVNCServerId); + connectionPresenter1.setIsTreeVNC(true); + connectionPresenter1.setNoConnection(false); + connectionPresenter1.setX(x); + connectionPresenter1.setY(y); + connectionPresenter1.setSingleWidth(width); + connectionPresenter1.setSingleHeight(height); + connectionPresenter1.setRetinaScale(scale); + connectionPresenter1.setMulticast(connectionPresenter.isUseMulticast()); // System.out.println("Sarver change accepted from id :" + newVNCServerId); return connectionPresenter; }