Stop() public method

public Stop ( ) : void
return void
Example #1
0
 public void TearDown()
 {
     if (_pipeServer != null)
     {
         _pipeServer.Stop();
     }
 }
Example #2
0
        void Start()
        {
            var autoEvent = new AutoResetEvent(false);

            centralPipeServer.ClientConnectedEvent    += CentralPipeServer_ClientConnectedEvent;
            centralPipeServer.ClientDisconnectedEvent += CentralPipeServer_ClientDisconnectedEvent;
            centralPipeServer.MessageReceivedEvent    += CentralPipeServer_MessageReceivedEvent;

            centralPipeServer.Stop();
            centralPipeServer.Start();

            Console.ReadLine();

            centralPipeServer.Stop();
        }
 protected override void OnStop()
 {
     if (!Daemonize)
     {
         RequestAdditionalTime(60000);
     }
     try
     {
         Pipe.Stop();
         RemoteManager.Stop(true);
         TunnelManager.Stop(true);
         NodeManager.Stop(true);
         if (TickThread != null)
         {
             TickThread.Abort();
         }
         UpdateManager.Stop(true);
     }
     catch { }
     LogManager.Stop();
     if (Daemonize)
     {
         Environment.Exit(0);
     }
 }
Example #4
0
 public void Stop()
 {
     m_logger.InfoFormat("Stopping service");
     PluginDriver.Stopping();
     DetachAbstractionsLibraryLogging();
     m_server.Stop();
 }
Example #5
0
 protected override void OnStop()
 {
     if (centralPipeServer != null)
     {
         centralPipeServer.Stop();
     }
 }
Example #6
0
        public void Dispose()
        {
            Logger.Debug("Shutting down MainManager");

            _processTimer?.Stop();
            _processTimer?.Dispose();
            LoopManager?.Stop();
            ModuleManager?.ActiveModule?.Dispose();
            GameStateWebServer?.Stop();
            PipeServer?.Stop();
        }
Example #7
0
        public void PipeServer_OnClose_CloseEventIsFired()
        {
            CreateServerPipe();
            _pipeServer.Start();

            var reset = new ManualResetEvent(false);

            _pipeServer.OnServerClosed += (sender, e) => reset.Set();
            _pipeServer.Stop();

            Assert.IsTrue(reset.WaitOne(200));
        }
Example #8
0
 public static void UnregisterServer()
 {
     try
     {
         _server.Stop();
         _server.MessageReceived -= _receivedAction.Invoke;
         _server = null;
     }
     catch (Exception e)
     {
         LogWriter.Log(e, "It was not possible to unregister the IPC server.");
     }
 }
Example #9
0
        public void TearDown()
        {
            if (_client != null)
            {
                _client.Stop();
                _client = null;
            }

            if (_server != null)
            {
                _server.Stop();
                _server = null;
            }
        }
Example #10
0
        private void Shutdown(Application app)
        {
            lock (_lockObject)
            {
                _logger.Debug("Shutting down the application");
                _isShuttingDown = true;

                if (PipeServer != null)
                {
                    _logger.Debug("Preparing PipeServer for ShutDown");
                    PipeServer.PrepareShutdown();
                }

                // convert _threads to array to prevent InvalidOperationException when an item is removed
                foreach (ISynchronizedThread t in _threads.ToArray())
                {
                    if (String.IsNullOrEmpty(t.Name))
                    {
                        _logger.Debug("Aborting thread");
                    }
                    else
                    {
                        _logger.Debug("Aborting thread " + t.Name);
                    }

                    t.Abort();
                }

                if (PipeServer != null)
                {
                    _logger.Debug("Saving settings");
                    SettingsHelper.SaveSettings();

                    _logger.Debug("Stopping pipe server");
                    PipeServer.Stop();
                }

                _logger.Debug("Exiting...");

                if (UpdateAfterShutdownAction != null)
                {
                    _logger.Debug("Starting application update...");
                    UpdateAfterShutdownAction();
                }

                app.Shutdown();
            }
        }
Example #11
0
        public void PipeServer_DoubleInstance_DoesNotThrowException()
        {
            CreateServerPipe();
            _pipeServer.Start();

            var pipeServer = new PipeServer(_pipeName, _pipeName);

            try
            {
                Assert.DoesNotThrow(() => pipeServer.Start());
            }
            finally
            {
                pipeServer.Stop();
            }
        }
        /// <summary>
        /// OnStop event
        /// </summary>
        protected override void OnStop()
        {
            Trace.WriteLine("MFANOTIFHUB:Stop ADFS Service");
            LogForSlots.LogEnabled = false;

            StopADFSService();

            _mailslotsmgr.Stop();

            _mailslotmfa.Stop();
            _mailslotmfa.MailSlotMessageArrived -= SyncMailSlotMessages;
            try
            {
                _pipeserver.Stop();
                _replaymgr.Close();
            }
            catch (Exception e)
            {
                this.EventLog.WriteEntry(string.Format("Pipe Server Error on Close : {0}.", e.Message), EventLogEntryType.Error, 1000);
            }
            this.EventLog.WriteEntry("Service was stopped successfully.", EventLogEntryType.Information, 1);
        }
Example #13
0
 internal void Stop()
 {
     _pipeServer.Stop();
 }
 public void Stop()
 {
     _pipeServer.Stop();
 }
Example #15
0
 protected override void OnStop()
 {
     pipeServer.Stop();
     ComponentRegulator.ManageComponentsState(null, null, true);
 }
 public override void StopServer()
 {
     _pipeServer.Stop();
     CanStartServer = true;
 }