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