System.Net.Cache.RequestCacheProtocol.Abort C# (CSharp) Method

Abort() private method

private Abort ( ) : void
return void
        internal void Abort()
        {
            // if _CanTakeNewRequest==true we should not be holding any cache stream
            // Also we check on Abort() reentrancy this way.
            if (_CanTakeNewRequest)
                return;

            // in case of abnormal termination this will release cache entry sooner than does it's finalizer
            Stream stream = _ResponseStream;
            if (stream != null)
            {
                try {
                    if(Logging.On) Logging.PrintWarning(Logging.RequestCache, SR.GetString(SR.net_log_cache_closing_cache_stream, "CacheProtocol#" + this.GetHashCode().ToString(NumberFormatInfo.InvariantInfo), "Abort()", stream.GetType().FullName, _Validator.CacheKey));
                    ICloseEx closeEx = stream as ICloseEx;
                    if (closeEx != null)
                        closeEx.CloseEx(CloseExState.Abort | CloseExState.Silent);
                    else
                        stream.Close();
                }
                catch(Exception e) {

                    if (NclUtilities.IsFatal(e)) throw;

                    if(Logging.On) Logging.PrintError(Logging.RequestCache, SR.GetString(SR.net_log_cache_exception_ignored, "CacheProtocol#" + this.GetHashCode().ToString(NumberFormatInfo.InvariantInfo), "stream.Close()", e.ToString()));
                }
            }
            Reset();
        }