示例#1
0
        protected override void OnStart(string[] args)
        {
            try
            {
                AppLogger.ShowAssembly = false;
                AppLogger.ShowClass    = false;
                AppLogger.ShowDate     = false;
                AppLogger.ShowMethod   = false;
                AppLogger.Message(DateTime.Now.ToString() + " " + Assembly.GetAssembly(typeof(MediaServer)).ToString());
                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
                if (ServiceMode)
                {
                    //this.RequestAdditionalTime(60000);
                }
                SetupNativeEnvironment();
//                QueryOriginServers.StartBackgroundThread();
                IndigoServices.Host.StartServices();
                GraphManager.ShutdownInProgress = false;
                GraphManager.StartPushGraphs();
//                _rtspServer = RTSP.RTSPServer.LoadFromFile();
//                if (_rtspServer != null)
//                {
//                    _rtspServer.Start();
//                }
                NetworkChange.NetworkAddressChanged      += new NetworkAddressChangedEventHandler(NetworkChange_NetworkAddressChanged);
                NetworkChange.NetworkAvailabilityChanged += new NetworkAvailabilityChangedEventHandler(NetworkChange_NetworkAvailabilityChanged);
                AppLogger.Message("MediaServer is READY");
            }
            catch (Exception exc)
            {
                AppLogger.Dump(exc);
            }
        }
示例#2
0
        protected override void OnStop()
        {
            if (_rtspServer != null)
            {
                _rtspServer.Stop();
            }
            GraphManager.ShutdownInProgress = true;
//            QueryOriginServers.StopBackgroundThread();
            GraphManager.StopAllGraphs();
            Thread.Sleep(2000);
            GraphManager.AbortAllGraphs();
            IndigoServices.Host.StopServices();
        }