예제 #1
0
 protected WindowConsole()
 {
     _AutoPowerRegulator = new AutoPowerRegulator(new PowerRegulator());
     Viewer = new ConsoleViewer();
     _Input = new ConsoleInput(Viewer);
     _Console = new Console(_Input, Viewer);
     _Updater = new Updater();
 }
예제 #2
0
 protected WindowConsole()
 {
     _AutoPowerRegulator = new AutoPowerRegulator(new PowerRegulator());
     Viewer   = new ConsoleViewer();
     _Input   = new ConsoleInput(Viewer);
     _Console = new Console(_Input, Viewer);
     _Updater = new Updater();
 }
예제 #3
0
 protected WindowConsole(Console.IViewer viewer, Console.IInput input)
 {
     _AutoPowerRegulator = new AutoPowerRegulator(new PowerRegulator());
     Viewer   = viewer;
     _Input   = input;
     _Console = new Console(_Input, Viewer);
     _Updater = new Updater();
 }
예제 #4
0
        public ThreadSocketHandler(int port, ThreadCoreHandler core_handler)
        {
            _CoreHandler = core_handler;
            _Port = port;

            _Sockets = new Queue<Socket>();

            _Peers = new PeerSet();

            _Spin = new PowerRegulator();
            _AutoPowerRegulator = new AutoPowerRegulator(_Spin);
        }
예제 #5
0
        public ThreadCoreHandler(ICore 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>();
        }
예제 #6
0
파일: Socket.cs 프로젝트: bmjoy/Regulus
 public System.Threading.Tasks.Task <int> Receive(byte[] buffer, int offset, int count)
 {
     return(System.Threading.Tasks.Task <int> .Run(() =>
     {
         int readCount = _Stream.Read(buffer, offset, count);
         AutoPowerRegulator r = new Regulus.Utility.AutoPowerRegulator(new PowerRegulator());
         while (readCount == 0)
         {
             r.Operate();
             readCount = _Stream.Read(buffer, offset, count);
         }
         return readCount;
     }));
 }
예제 #7
0
        public IWaitableValue <int> Receive(byte[] buffer, int offset, int count)
        {
            var task = System.Threading.Tasks.Task <int> .Run(() =>
            {
                int readCount = 0;
                var r         = new Regulus.Utility.AutoPowerRegulator(new PowerRegulator());
                while (readCount == 0)
                {
                    r.Operate();
                    readCount = _Stream.Read(buffer, offset, count);
                }
                return(readCount);
            });

            return(task.ToWaitableValue());
        }