System.Web.HttpRuntime.FinishUnavailable C# (CSharp) Method

FinishUnavailable() static private method

static private FinishUnavailable ( HttpWorkerRequest wr ) : void
wr HttpWorkerRequest
return void
		static internal void FinishUnavailable (HttpWorkerRequest wr)
		{
			wr.SendStatus (503, "Service unavailable");
			wr.SendUnknownResponseHeader ("Connection", "close");
			Encoding enc = Encoding.ASCII;
			wr.SendUnknownResponseHeader ("Content-Type", "text/html; charset=" + enc.WebName);
			byte [] contentBytes = enc.GetBytes (content503);
			wr.SendUnknownResponseHeader ("Content-Length", contentBytes.Length.ToString ());
			wr.SendResponseFromMemory (contentBytes, contentBytes.Length);
			wr.FlushResponse (true);
			wr.CloseConnection ();
			HttpApplication.requests_total_counter.Increment ();
		}

Usage Example

Example #1
0
        void Queue(HttpWorkerRequest wr)
        {
            if (queue.Count < queueLimit)
            {
                queue.Enqueue(wr);
                requestsQueuedCounter.Increment();
                return;
            }

            HttpRuntime.FinishUnavailable(wr);
        }
All Usage Examples Of System.Web.HttpRuntime::FinishUnavailable