示例#1
0
        static void Main(string[] args)
        {
            if (!GetNodeName(args))
            {
                System.Console.WriteLine(" [X] Node name not specified");
                return;
            }
            NodeNetwork = new NodeNetwork();
            ReadConfig();
            Console.WriteLine($"ManagingPort = |{Instance.ManagingPort}| NodeConnectionPort  = |{Instance.NodeConnectionPort }|");
            NodeNetwork.Start(Instance);
            Task.Factory.StartNew(state => ServerActivity(), string.Format($"Server {Instance.Name}"), TaskCreationOptions.LongRunning);
            Task.Factory.StartNew(state => NodeActivity(), string.Format($"Node {Instance.Name}"), TaskCreationOptions.LongRunning);

            System.Console.ReadKey();
            return;
        }
示例#2
0
        private static void Main(string[] args)
        {
            if (!GetNodeNameFromArguments(args))
            {
                System.Console.WriteLine("Error: Node name not specified");
                return;
            }

            _logFile     = new LogFile($"{me.Name}.log");
            _nodeNetwork = new NodeNetwork(_logFile);
            ReadConfig();
            _nodeNetwork.Start(me);
            Task.Factory.StartNew(state => ServerActivity(), string.Format($"Server {me.Name}"), TaskCreationOptions.LongRunning);
            Task.Factory.StartNew(state => NodeActivity(), string.Format($"Node {me.Name}"), TaskCreationOptions.LongRunning);

            System.Console.ReadKey();
        }