Esempio n. 1
0
 public AsyncQueueReader(InputQueue <T> inputQueue, TimeSpan timeout, AsyncCallback callback, object state)
     : base(callback, state)
 {
     if (inputQueue.AsyncCallbackGenerator != null)
     {
         base.VirtualCallback = inputQueue.AsyncCallbackGenerator();
     }
     _inputQueue = inputQueue;
     if (timeout != TimeSpan.MaxValue)
     {
         _timer = new Timer(new TimerCallback(s_timerCallback), this, timeout, TimeSpan.FromMilliseconds(-1));
     }
 }
Esempio n. 2
0
 public AsyncQueueReader(InputQueue <T> inputQueue, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
 {
     if (inputQueue.AsyncCallbackGenerator != null)
     {
         base.VirtualCallback = inputQueue.AsyncCallbackGenerator();
     }
     this.inputQueue = inputQueue;
     if (timeout != TimeSpan.MaxValue)
     {
         this.timer = new IOThreadTimer(InputQueue <T> .AsyncQueueReader.timerCallback, this, false);
         this.timer.Set(timeout);
     }
 }