Example #1
0
        public void Shutdown(bool keepDb = false, bool keepPorts = false)
        {
            StoppingTime.Start();

            var shutdownEvent = new ManualResetEventSlim(false);

            Node.MainBus.Subscribe(new AdHocHandler <SystemMessage.BecomeShutdown>(m => shutdownEvent.Set()));

            Node.Stop(exitProcess: true);

            if (!shutdownEvent.Wait(20000))
            {
                throw new TimeoutException("MiniNode haven't shut down in 20 seconds.");
            }

            if (!keepPorts)
            {
                PortsHelper.ReturnPort(TcpEndPoint.Port);
                PortsHelper.ReturnPort(TcpSecEndPoint.Port);
                PortsHelper.ReturnPort(HttpEndPoint.Port);
            }

            if (!keepDb)
            {
                TryDeleteDirectory(_dbPath);
            }

            StoppingTime.Stop();
            RunningTime.Stop();

            _running = false;
        }
Example #2
0
        public void Shutdown()
        {
            _node.Stop();
            Thread.Sleep(2000);

            _chaserChk.Dispose();
            _writerChk.Dispose();
            _tfChunkDb.Dispose();

            TryDeleteDirectory(_oneTimeDbPath);
        }
Example #3
0
 public void Stop()
 {
     if (_connection != null)
     {
         _connection.Close();
     }
     if (_node != null)
     {
         _node.Stop(false);
     }
 }
Example #4
0
        protected virtual void TearDown()
        {
            try
            {
                var shutdownCallback = new EnvelopeCallback <SystemMessage.BecomeShutdown>();
                _vNode.Bus.Subscribe <SystemMessage.BecomeShutdown>(shutdownCallback);

                _vNode.Stop();

                shutdownCallback.Wait();

                _db.Dispose();
                _writerChk.Dispose();
                _chaserChk.Dispose();
                Directory.Delete(_db.Config.Path, true);

                _vNode = null;
                _db    = null;
            }
            catch (Exception)
            {
            }
        }
Example #5
0
 public override void Stop()
 {
     _node.Stop();
 }
Example #6
0
 public override void Stop()
 {
     _node.Stop(exitProcess: true);
 }