Example #1
0
 bool IUpdatable.Update()
 {
     _AutoPowerRegulator.Operate();
     _Update();
     _Updater.Working();
     return(true);
 }
Example #2
0
 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;
     }));
 }
Example #3
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());
        }