示例#1
0
 public override void CloseConnection()
 {
     if (log.IsDebugEnabled)
     {
         log.Debug("Calling CloseConnection()");
     }
     OrigWorker.CloseConnection();
 }
示例#2
0
        static void Redirect(HttpWorkerRequest wr, string location)
        {
            string host = wr.GetKnownRequestHeader(HttpWorkerRequest.HeaderHost);

            wr.SendStatus(301, "Moved Permanently");
            wr.SendUnknownResponseHeader("Connection", "close");
            wr.SendUnknownResponseHeader("Date", DateTime.Now.ToUniversalTime().ToString("r"));
            wr.SendUnknownResponseHeader("Location", String.Format("http://{0}{1}", host, location));
            Encoding enc = Encoding.ASCII;

            wr.SendUnknownResponseHeader("Content-Type", "text/html; charset=" + enc.WebName);
            string content = String.Format(CONTENT301, host, location);

            byte [] contentBytes = enc.GetBytes(content);
            wr.SendUnknownResponseHeader("Content-Length", contentBytes.Length.ToString());
            wr.SendResponseFromMemory(contentBytes, contentBytes.Length);
            wr.FlushResponse(true);
            wr.CloseConnection();
        }
示例#3
0
 /// <summary>
 /// Terminates the connection with the client.
 /// </summary>
 public override void CloseConnection()
 {
     _request.CloseConnection();
 }
示例#4
0
 public override void CloseConnection()
 {
     _httpWorkerRequest.CloseConnection();
 }