Mercurial > hg > Database > Alice
view src/test/java/alice/daemon/MulticastStartCodeSegment.java @ 549:9f577ff4f7ea dispose
resolve TopologyManager NullPointerException
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 06 Oct 2015 17:50:53 +0900 |
parents | e91a574b69de |
children |
line wrap: on
line source
package alice.daemon; import alice.codesegment.CodeSegment; import alice.datasegment.MulticastDataSegmentManager.SocketType; public class MulticastStartCodeSegment extends CodeSegment { private Config conf; public MulticastStartCodeSegment(Config conf) { this.conf = conf; } @Override public void run() { aliceDaemon.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("multicast","num", this); ods.put("multicast", "num", 0); } else if (MulticastTest.type == SocketType.Receiver){ aliceDaemon.dataSegment.connectMulticast("multicast1", "224.0.0.2", conf.localPort+1, conf.nis, SocketType.Sender); ReceiveInteger cs = new ReceiveInteger(); cs.num.setKey("num", this); } else if (MulticastTest.type == SocketType.Sender){ aliceDaemon.dataSegment.connectMulticast("multicast1", "224.0.0.2", conf.localPort+1, conf.nis, SocketType.Receiver); ReceiveString cs = new ReceiveString(); cs.str.setKey("str", this); for (int i=0;i < 11; i++) ods.put("multicast", "num", i); } } }