示例#1
0
        public NetworkJoinModel()
        {
            UpdateState(State.Ready);

            _node = new ZenithNetworkNode();
            _node.Initialize();
        }
示例#2
0
文件: Network.cs 项目: Civa/Zenith
        public void Run()
        {
            //NetworkConfig worldwideConfig = new NetworkConfig();
            //INetworkTransmission worldwideTransmission = new TcpNetworkTransmission(worldwideConfig);
            //INetworkCoordinator<NodeMetadata> worldwide = new WorldwideNetworkCoordinator(worldwideTransmission);

            //NetworkConfig localConfig = new NetworkConfig();
            //INetworkTransmission localTransmission = new TcpNetworkTransmission(localConfig);
            //INetworkCoordinator<NodeMetadata> local = new LocalNetworkCoordinator(localTransmission);

            //Node node = new Node();
            //node.AddCoordinator(worldwide);
            //node.AddCoordinator(local);

            //node.JoinNetwork(CancellationToken.None);

            //NetworkNode node = new NetworkNode();

            //INetworkProvider global = new GlobalNetworkProvider(new GlobalNetworkServiceContainer());
            //INetworkProvider local = new LocalNetworkProvider(new LocalNetworkServiceContainer());

            //node.NetworkProviders.Add("Global", global);
            //node.NetworkProviders.Add("Local", local);

            //node.Join();

            ZenithNetworkNode node = new ZenithNetworkNode();
            node.Initialize();
            node.Join();
        }