Пример #1
0
 void _service_CloseConnectionEvent(object sender, ConnectionEventArgs e)
 {
     if (_document._limitConnections && (_connsLeft == 0) && (_service.Connections.Length == 0))
     {
         _service.Stop();
     }
 }
Пример #2
0
        private void StopService()
        {
            bool stopped = false;

            try
            {
                if (_service != null)
                {
                    _service.Stop();
                    stopped = true;
                }
            }
            catch (Exception ex)
            {
                eventLogControl.Logger.LogException(ex);
            }
            finally
            {
                if (!stopped)
                {
                    OnServiceStop();
                }
            }
        }