Пример #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
        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
 public Listener(RPWebServer rpwebserver)
 {
     this.rpwebserver = rpwebserver;
 }