コード例 #1
0
        System.Timers.Timer checkThreadTimer; // checks if the thread is alive

        public ThreadController()
        {
            // DONT Initialize server here -- could delay service startup (will only proceed if not already initialized)
            // instead do it in rpwebserver() below, and flag so it only INITs once

            mainServer = new RPWebServer("Main server", Convert.ToInt32(Settings.Default.Port), "/", false);   // create the main server object
            mainServer.AccessDenied += new EventHandler(theServer_AccessDenied);

            ServerStoppedReason = ServerStoppedReasons.UserStopped;

            checkThreadTimer           = new System.Timers.Timer(1000);
            checkThreadTimer.Interval  = 1000;
            checkThreadTimer.AutoReset = true;
            checkThreadTimer.Elapsed  += new System.Timers.ElapsedEventHandler(checkThreadTimer_Elapsed);
            checkThreadTimer.Start();
        }
コード例 #2
0
ファイル: ThreadController.cs プロジェクト: piet5211/RPLiveTV
        Thread theThread; // the new thread the main server will live on

        #endregion Fields

        #region Constructors

        //        public ThreadController()
        //888888
        public ThreadController(object caller)
        {
            // DONT Initialize server here -- could delay service startup (will only proceed if not already initialized)
            // instead do it in rpwebserver() below, and flag so it only INITs once

            //88888
            mainServer = new RPWebServer("Main server", Convert.ToInt32(Settings.Default.RPPort), "/", false, caller);   // create the main server object
            //            mainServer = new RPWebServer("Main server", Convert.ToInt32(Settings.Default.Port), "/", false);   // create the main server object
            mainServer.AccessDenied += new EventHandler(theServer_AccessDenied);

            ServerStoppedReason = ServerStoppedReasons.UserStopped;

            checkThreadTimer = new System.Timers.Timer(1000);
            checkThreadTimer.Interval = 1000;
            checkThreadTimer.AutoReset = true;
            checkThreadTimer.Elapsed += new System.Timers.ElapsedEventHandler(checkThreadTimer_Elapsed);
            checkThreadTimer.Start();
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: piet5211/RPLiveTV
 public Listener(RPWebServer rpwebserver)
 {
     this.rpwebserver = rpwebserver;
 }