Esempio n. 1
0
        internal void Add(HttpContext context)
        {
            if (context.TimeoutLink != null)
            {
                ((RequestTimeoutEntry)context.TimeoutLink).IncrementCount();
                return;
            }

            // create new entry

            RequestTimeoutEntry entry = new RequestTimeoutEntry(context);

            // add it to the list

            int i = _currentList++;

            if (i >= _lists.Length)
            {
                i            = 0;
                _currentList = 0;
            }

            entry.AddToList(_lists[i]);
            Interlocked.Increment(ref _requestCount);

            // update HttpContext
            context.TimeoutLink = entry;
        }
        internal void Remove(HttpContext context)
        {
            RequestTimeoutEntry entry = (RequestTimeoutEntry)context.TimeoutLink;

            // remove from the list
            if (entry != null)
            {
                entry.RemoveFromList();
                Interlocked.Decrement(ref _requestCount);
            }

            // update HttpContext
            context.TimeoutLink = null;
        }
        internal void Remove(HttpContext context)
        {
            RequestTimeoutEntry timeoutLink = (RequestTimeoutEntry)context.TimeoutLink;

            if (timeoutLink != null)
            {
                if (timeoutLink.DecrementCount() != 0)
                {
                    return;
                }
                timeoutLink.RemoveFromList();
                Interlocked.Decrement(ref this._requestCount);
            }
            context.TimeoutLink = null;
        }
 internal void Add(TdsContext context)
 {
     if (context.TimeoutLink != null)
         ((RequestTimeoutEntry)context.TimeoutLink).IncrementCount();
     else
     {
         var entry = new RequestTimeoutEntry(context);
         var index = _currentList++;
         if (index >= _lists.Length)
         {
             index = 0;
             _currentList = 0;
         }
         entry.AddToList(_lists[index]);
         Interlocked.Increment(ref _requestCount);
         context.TimeoutLink = entry;
     }
 }
 internal void Add(HttpContext context)
 {
     if (context.TimeoutLink != null)
     {
         ((RequestTimeoutEntry) context.TimeoutLink).IncrementCount();
     }
     else
     {
         RequestTimeoutEntry entry = new RequestTimeoutEntry(context);
         int index = this._currentList++;
         if (index >= this._lists.Length)
         {
             index = 0;
             this._currentList = 0;
         }
         entry.AddToList(this._lists[index]);
         Interlocked.Increment(ref this._requestCount);
         context.TimeoutLink = entry;
     }
 }
Esempio n. 6
0
 internal void Add(HttpListenerWorkerRequest wr)
 {
     if (wr.TimeoutLink != null)
     {
         ((RequestTimeoutEntry)wr.TimeoutLink).IncrementCount();
     }
     else
     {
         var entry = new RequestTimeoutEntry(wr);
         int index = _currentList++;
         if (index >= _lists.Length)
         {
             index        = 0;
             _currentList = 0;
         }
         entry.AddToList(_lists[index]);
         Interlocked.Increment(ref _requestCount);
         wr.TimeoutLink = entry;
     }
 }
 internal void Add(HttpContext context)
 {
     if (context.TimeoutLink != null)
     {
         ((RequestTimeoutEntry)context.TimeoutLink).IncrementCount();
     }
     else
     {
         RequestTimeoutEntry entry = new RequestTimeoutEntry(context);
         int index = this._currentList++;
         if (index >= this._lists.Length)
         {
             index             = 0;
             this._currentList = 0;
         }
         entry.AddToList(this._lists[index]);
         Interlocked.Increment(ref this._requestCount);
         context.TimeoutLink = entry;
     }
 }
        internal void Add(HttpContext context) {
            if (context.TimeoutLink != null) {
                ((RequestTimeoutEntry)context.TimeoutLink).IncrementCount();
                return;
            }
           
            // create new entry

            RequestTimeoutEntry entry = new RequestTimeoutEntry(context);

            // add it to the list

            int i = _currentList++;
            if (i >= _lists.Length) {
                i = 0;
                _currentList = 0;
            }

            entry.AddToList(_lists[i]);
            Interlocked.Increment(ref _requestCount);

            // update HttpContext
            context.TimeoutLink = entry;
        }