Ejemplo n.º 1
0
        /// <summary>
        ///  Creates a new Mainloop, to run it you must provide a driver, and choose
        ///  one of the implementations UnixMainLoop, NetMainLoop or WindowsMainLoop.
        /// </summary>
        public MainLoop(IMainLoopDriver driver)
        {
            this.driver = driver;

            _timeouts0        = new SortedList <long, Timeout>();
            _timeouts1        = new SortedList <long, Timeout>();
            Timeouts          = _timeouts0;
            _parityTimeoutsId = 0;
            _timeoutsLocker   = new object();

            _idleHandlers0      = new List <Action>();
            _idleHandlers1      = new List <Action>();
            IdleHandlers        = _idleHandlers0;
            _parityIdleHandlers = 0;
            _idleHandlersLocker = new object();

            driver.Setup(this);
        }
Ejemplo n.º 2
0
 /// <summary>
 ///  Creates a new Mainloop.
 /// </summary>
 /// <param name="driver">Should match the <see cref="ConsoleDriver"/> (one of the implementations UnixMainLoop, NetMainLoop or WindowsMainLoop).</param>
 public MainLoop(IMainLoopDriver driver)
 {
     Driver = driver;
     driver.Setup(this);
 }