System.Web.HttpResponseStream.Flush C# (CSharp) Method

Flush() private method

private Flush ( System.Web.HttpWorkerRequest wr, bool final_flush ) : void
wr System.Web.HttpWorkerRequest
final_flush bool
return void
		internal void Flush (HttpWorkerRequest wr, bool final_flush)
		{
			if (total == 0 && !final_flush)
				return;

			if (response.use_chunked) 
				SendChunkSize (total, false);

			for (Bucket b = first_bucket; b != null; b = b.Next) {
				b.Send (wr);
			}

			if (response.use_chunked) {
				SendChunkSize (-1, false);
				if (final_flush)
					SendChunkSize (0, true);
			}

			wr.FlushResponse (final_flush);

			Clear ();
		}

Same methods

HttpResponseStream::Flush ( ) : void

Usage Example

Example #1
0
        internal void Flush(bool final_flush)
        {
            if (completed)
            {
                throw new HttpException("Server cannot flush a completed response");
            }

            DoFilter(final_flush);
            if (!headers_sent)
            {
                if (final_flush || status_code != 200)
                {
                    use_chunked = false;
                }
            }

            bool head = ((context != null) && (context.Request.HttpMethod == "HEAD"));

            if (suppress_content || head)
            {
                if (!headers_sent)
                {
                    WriteHeaders(true);
                }
                output_stream.Clear();
                if (WorkerRequest != null)
                {
                    output_stream.Flush(WorkerRequest, true);                      // ignore final_flush here.
                }
                completed = true;
                return;
            }
            completed = final_flush;

            if (!headers_sent)
            {
                WriteHeaders(final_flush);
            }

            if (context != null)
            {
                HttpApplication app_instance = context.ApplicationInstance;
                if (app_instance != null)
                {
                    app_instance.TriggerPreSendRequestContent();
                }
            }

            if (IsCached)
            {
                cached_response.SetData(output_stream.GetData());
            }

            if (WorkerRequest != null)
            {
                output_stream.Flush(WorkerRequest, final_flush);
            }
        }
All Usage Examples Of System.Web.HttpResponseStream::Flush