public void Stop() { try { LogOut(); } catch { } if (serviceServer != null) { serviceServer.Stop(); serviceServer.Dispose(); serviceServer = null; } if (textServer != null) { textServer.Stop(); textServer.Dispose(); textServer = null; } if (fileServer != null) { fileServer.Stop(); fileServer.Dispose(); fileServer = null; } }
public void Stop() { if (!IsRunning) { return; } MonitorPool.Singleton.Exit(); IsRunning = false; ListenServer.Stop(); ServiceServer.Stop(); Client.Disconnect(); }
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); }