Mercurial > hg > Database > Alice
view src/test/java/alice/daemon/MulticastStartCodeSegment.java @ 607:3ae176ada1d7 dispose
close
author | suruga |
---|---|
date | Wed, 19 Apr 2017 19:21:23 +0900 |
parents | 767d93626b88 |
children |
line wrap: on
line source
package alice.daemon; import alice.codesegment.CodeSegment; import alice.datasegment.DataSegment; import alice.datasegment.MulticastDataSegmentManager.SocketType; public class MulticastStartCodeSegment extends CodeSegment { private Config conf; public MulticastStartCodeSegment(Config conf) { this.conf = conf; } @Override public void run() { DataSegment.connectMulticast("multicast",conf.MCSTADDR, conf.localPort, conf.nis, MulticastTest.type); if (MulticastTest.type == SocketType.Both) { // in this case "multicast" key mean local. MulticastIncrement cs = new MulticastIncrement(); cs.num.setKey("compressedmulticast","num"); ods.put("compressedlmulticast", "num", 0); } else if (MulticastTest.type == SocketType.Receiver){ DataSegment.connectMulticast("multicast1", "224.0.0.2", conf.localPort+1, conf.nis, SocketType.Sender); ReceiveInteger cs = new ReceiveInteger(); cs.num.setKey("compressedlocal","num"); } else if (MulticastTest.type == SocketType.Sender){ DataSegment.connectMulticast("multicast1", "224.0.0.2", conf.localPort+1, conf.nis, SocketType.Receiver); ReceiveString cs = new ReceiveString(); cs.str.setKey("compressedlocal","str"); for (int i=0;i < 11; i++) ods.put("compressedmulticast", "num", i); } } }