Exemple #1
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);
        }
Exemple #2
0
 private void MainWindow_Closing(object sender, CancelEventArgs e)
 {
     ClientServer.Stop();
     CancelPing.Cancel();
 }
Exemple #3
0
        public void Dispose()
        {
            Assert.IsNotNull(server);

            server.Stop();
        }