Mercurial > hg > Database > Christie-sharp
view Test/Topology/TreeTestTopology/StartTreeTestTopology.cs @ 71:1169915705ab default tip
fix TopologyNode connect
author | KaitoMaeshiro <aosskaito@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 06 Feb 2022 16:47:41 +0900 |
parents | 976d43003487 |
children |
line wrap: on
line source
using System; using System.Net; using System.Threading; using Christie_net.codegear; using Christie_net.topology.manager; using Christie_net.topology.node; namespace Christie_net.Test.Topology.TreeTestTopology { public class StartTreeTestTopology : StartCodeGear { public StartTreeTestTopology(CodeGearManager cgm) : base(cgm) { } public static void Main(String[] args) { int topologyManagerPort = 10000; int topologyNodePort = 10001; int nodeNum = 3; String[] managerArg = {"--localPort", topologyManagerPort.ToString(), "--Topology", "tree"}; TopologyManagerConfig topologyManagerConfig = new TopologyManagerConfig(managerArg); new StartTopologyManager(topologyManagerConfig); for (int i = 0; i < nodeNum; i++) { String[] nodeArg = { "--managerPort", topologyManagerPort.ToString(), "--managerHost", "localhost", "--localPort", (topologyNodePort + i).ToString()}; TopologyNodeConfig cs = new TopologyNodeConfig(nodeArg); new StartTopologyNode(cs, new ChildCodeGear()).Put("maxNodeNum", topologyManagerConfig.hasChild); } Thread.Sleep(10000); Console.WriteLine("TopologyManager done"); } } }