Mercurial > hg > Database > Alice
view src/test/java/alice/daemon/MulticastStartCodeSegment.java @ 655:1c93e82e05c6 default tip
fix timestamp
author | suruga |
---|---|
date | Sat, 17 Feb 2018 00:33:00 +0900 |
parents | b7d02ea79850 |
children | 0832af83583f 767d93626b88 |
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("multicast","num"); ods.put("multicast", "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("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("str"); for (int i=0;i < 11; i++) ods.put("multicast", "num", i); } } }