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