internal HttpListenerContext (HttpConnection connection)
 {
   _connection = connection;
   _errorStatus = 400;
   _request = new HttpListenerRequest (this);
   _response = new HttpListenerResponse (this);
 }
    /// <summary>
    /// Copies properties from the specified <see cref="HttpListenerResponse"/> to this response.
    /// </summary>
    /// <param name="templateResponse">
    /// A <see cref="HttpListenerResponse"/> to copy.
    /// </param>
    /// <exception cref="InvalidOperationException">
    /// The response has already been sent.
    /// </exception>
    /// <exception cref="ObjectDisposedException">
    /// This object is closed.
    /// </exception>
    public void CopyFrom (HttpListenerResponse templateResponse)
    {
      checkDisposedOrHeadersSent ();

      _headers.Clear ();
      _headers.Add (templateResponse._headers);
      _contentLength = templateResponse._contentLength;
      _statusCode = templateResponse._statusCode;
      _statusDescription = templateResponse._statusDescription;
      _keepAlive = templateResponse._keepAlive;
      _version = templateResponse._version;
    }
Beispiel #3
0
 internal ResponseStream (Stream stream, HttpListenerResponse response, bool ignoreErrors)
 {
   _stream = stream;
   _response = response;
   _ignoreErrors = ignoreErrors;
 }
 internal HttpRequestEventArgs (HttpListenerContext context)
 {
   _request = context.Request;
   _response = context.Response;
 }