示例#1
0
        private void TsbStart_Click(object sender, EventArgs e)
        {
            CS = new ClientServer();
            CS.Start();

            tsbStart.Enabled = false;
            tsbStop.Enabled  = true;
            //mainTimer.Enabled = true;

            MessageBox.Show("CS服务器启动成功!", "服务器启动", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
示例#2
0
        public async Task <int> Run()
        {
            if (_quitToken.IsCancellationRequested)
            {
                return(0);
            }

            await Kademlia.Start();

            TransactionManager.Start();
            await CouncilManager.Start();

            await NodeServer.Start();

            await ClientServer.Start();

            if (ServiceServer != null)
            {
                await ServiceServer.Start();
            }

            await _quitToken.WaitAsync();

            await PubSub.PublishAsync(new QuitEvent());

            await NodeServer.Stop();

            await ClientServer.Stop();

            await CouncilManager.Stop();

            TransactionManager.Stop();
            await Kademlia.Stop();

            await ChainManager.Stop();

            if (ServiceServer != null)
            {
                await ServiceServer.Stop();
            }

            await(Host as Host).Stop();

            return(0);
        }