System.Net.HttpListenerRequest.Close C# (CSharp) Method

Close() private method

private Close ( ) : void
return void
        internal void Close()
        {
            if (NetEventSource.IsEnabled) NetEventSource.Enter(this);
            RequestContextBase memoryBlob = _memoryBlob;
            if (memoryBlob != null)
            {
                memoryBlob.Close();
                _memoryBlob = null;
            }
            _isDisposed = true;
            if (NetEventSource.IsEnabled) NetEventSource.Exit(this);
        }

Usage Example

Esempio n. 1
0
        internal void Close()
        {
            if (Logging.On)
            {
                Logging.Enter(Logging.HttpListener, this, "Close()", "");
            }

            try {
                if (m_Response != null)
                {
                    m_Response.Close();
                }
            }
            finally {
                try {
                    m_Request.Close();
                }
                finally {
                    IDisposable user = m_User == null ? null : m_User.Identity as IDisposable;

                    // For unsafe connection ntlm auth we dont dispose this identity as yet since its cached
                    if ((user != null) &&
                        (m_User.Identity.AuthenticationType != NTLM) &&
                        (!m_Listener.UnsafeConnectionNtlmAuthentication))
                    {
                        user.Dispose();
                    }
                }
            }
            if (Logging.On)
            {
                Logging.Exit(Logging.HttpListener, this, "Close", "");
            }
        }