ProcessRequestNow() private method

private ProcessRequestNow ( ) : void
return void
Exemplo n.º 1
0
        // method called to pick up more work
        private void WorkItemCallback(Object state)
        {
            Interlocked.Decrement(ref _workItemCount);

            // is queue empty?
            if (_count == 0)
            {
                return;
            }

            int workerThreads, ioThreads;

            ThreadPool.GetAvailableThreads(out workerThreads, out ioThreads);

            bool bHandledRequest = false;

            // service another request if enough worker threads are available
            if (workerThreads >= _minLocalFreeThreads)
            {
                // pick up request from the queue
                SocketHandler sh = DequeueRequest(workerThreads < _minExternFreeThreads);
                if (sh != null)
                {
                    sh.ProcessRequestNow();
                    bHandledRequest = true;
                }
            }

            if (!bHandledRequest)
            {
                Thread.Sleep(250);
                ScheduleMoreWorkIfNeeded();
            }
        }
Exemplo n.º 2
0
 private void WorkItemCallback(object state)
 {
     Interlocked.Decrement(ref this._workItemCount);
     if (this._count != 0)
     {
         int num;
         int num2;
         ThreadPool.GetAvailableThreads(out num, out num2);
         bool flag = false;
         if (num >= this._minLocalFreeThreads)
         {
             SocketHandler handler = this.DequeueRequest(num < this._minExternFreeThreads);
             if (handler != null)
             {
                 handler.ProcessRequestNow();
                 flag = true;
             }
         }
         if (!flag)
         {
             Thread.Sleep(250);
             this.ScheduleMoreWorkIfNeeded();
         }
     }
 }
Exemplo n.º 3
0
 internal void ProcessNextRequest(SocketHandler sh)
 {
     sh = this.GetRequestToExecute(sh);
     if (sh != null)
     {
         sh.ProcessRequestNow();
     }
 }
Exemplo n.º 4
0
        // method called to process the next request
        internal void ProcessNextRequest(SocketHandler sh)
        {
            sh = GetRequestToExecute(sh);

            if (sh != null)
                sh.ProcessRequestNow();
        } // ProcessNextRequest