Provides a concrete implementation of the IHttpResponse interface based on a HttpListenerResponse.
Inheritance: System.MarshalByRefObject, IHttpResponse, IDisposable
Ejemplo n.º 1
0
        /// <summary>
        ///     Releases unmanaged and - optionally - managed resources.
        /// </summary>
        /// <param name="disposing">
        ///     <c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.
        /// </param>
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (_request != null)
                {
                    _request.Dispose();
                    _request = null;
                }

                if (_response != null)
                {
                    _response.Dispose();
                    _response = null;
                }
            }

            _disposed = true;
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     Updates the context based on an HttpListenerContext.
 /// </summary>
 /// <param name="context">The HttpListenerContext used to update this instance.</param>
 private void ApplyNewContext(HttpListenerContext context)
 {
     _request = new HttpRequest(context.Request);
     _response = new HttpResponse(context.Response);
 }