Beispiel #1
0
        public ThreadCoreHandler(IEntry core)
        {
            if (core == null)
            {
                throw new ArgumentNullException(nameof(core));
            }

            _Core = core;

            _RequesterHandlers = new Updater();
            _Spin = new PowerRegulator();
            _AutoPowerRegulator = new AutoPowerRegulator(_Spin);
            _Binders            = new Queue <ISoulBinder>();
        }
Beispiel #2
0
        internal void Run(object obj)
        {
            var are = (AutoResetEvent)obj;

            var powerRegulator     = new PowerRegulator(10);
            var autoPowerRegulator = new AutoPowerRegulator(powerRegulator);

            while (_HasValue == false)
            {
                autoPowerRegulator.Operate();
            }

            are.Set();
        }
        public ThreadSocketHandler(int port, ThreadCoreHandler core_handler, IProtocol protocol, IListenable server)
        {
            _CoreHandler = core_handler;
            _Protocol    = protocol;
            _Port        = port;

            _Sockets = new Queue <IPeer>();

            _Peers = new PeerSet();

            _Spin = new PowerRegulator();
            _AutoPowerRegulator = new AutoPowerRegulator(_Spin);

            _Server = server;
        }
Beispiel #4
0
 public AutoPowerRegulator(PowerRegulator power_regulator)
 {
     _Counter        = new TimeCounter();
     _PreviousTicks  = _Counter.Ticks;
     _PowerRegulator = power_regulator;
 }
 public AutoPowerRegulator(PowerRegulator power_regulator)
 {
     _Counter = new TimeCounter();
     _PreviousTicks = _Counter.Ticks;
     _PowerRegulator = power_regulator;
 }