protected WindowConsole() { _AutoPowerRegulator = new AutoPowerRegulator(new PowerRegulator()); Viewer = new ConsoleViewer(); _Input = new ConsoleInput(Viewer); _Console = new Console(_Input, Viewer); _Updater = new Updater(); }
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(); }
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); }
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>(); }
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()); }