void WriteReturns(object[] returnValues)
        {
            if (protocol.IsOneWay)
            {
                return;
            }

            // By default ASP.NET will fully buffer the response. If BufferResponse=false
            // then we still want to do partial buffering since each write is a named
            // pipe call over to inetinfo.
            bool   fullyBuffered = protocol.MethodAttribute.BufferResponse;
            Stream outputStream  = protocol.Response.OutputStream;

            if (!fullyBuffered)
            {
                outputStream = new BufferedResponseStream(outputStream, 16 * 1024);
                //#if DEBUG
                ((BufferedResponseStream)outputStream).FlushEnabled = false;
                //#endif
            }
            protocol.WriteReturns(returnValues, outputStream);
            // This will flush the buffered stream and the underlying stream. Its important
            // that it flushes the Response.OutputStream because we always want BufferResponse=false
            // to mean we are writing back a chunked response. This gives a consistent
            // behavior to the client, independent of the size of the partial buffering.
            if (!fullyBuffered)
            {
                //#if DEBUG
                ((BufferedResponseStream)outputStream).FlushEnabled = true;
                //#endif
                outputStream.Flush();
            }
        }
 private void WriteReturns(object[] returnValues)
 {
     if (!this.protocol.IsOneWay)
     {
         bool   bufferResponse = this.protocol.MethodAttribute.BufferResponse;
         Stream outputStream   = this.protocol.Response.OutputStream;
         if (!bufferResponse)
         {
             outputStream = new BufferedResponseStream(outputStream, 0x4000);
             ((BufferedResponseStream)outputStream).FlushEnabled = false;
         }
         this.protocol.WriteReturns(returnValues, outputStream);
         if (!bufferResponse)
         {
             ((BufferedResponseStream)outputStream).FlushEnabled = true;
             outputStream.Flush();
         }
     }
 }
        void WriteReturns(object[] returnValues) {
            if (protocol.IsOneWay) return;

            // By default ASP.NET will fully buffer the response. If BufferResponse=false
            // then we still want to do partial buffering since each write is a named
            // pipe call over to inetinfo.
            bool fullyBuffered = protocol.MethodAttribute.BufferResponse;
            Stream outputStream = protocol.Response.OutputStream;
            if (!fullyBuffered) {
                outputStream = new BufferedResponseStream(outputStream, 16 * 1024);
                //#if DEBUG
                ((BufferedResponseStream)outputStream).FlushEnabled = false;
                //#endif
            }
            protocol.WriteReturns(returnValues, outputStream);
            // This will flush the buffered stream and the underlying stream. Its important
            // that it flushes the Response.OutputStream because we always want BufferResponse=false
            // to mean we are writing back a chunked response. This gives a consistent
            // behavior to the client, independent of the size of the partial buffering.
            if (!fullyBuffered) {
                //#if DEBUG
                ((BufferedResponseStream)outputStream).FlushEnabled = true;
                //#endif
                outputStream.Flush();
            }
        }
 private void WriteReturns(object[] returnValues)
 {
     if (!this.protocol.IsOneWay)
     {
         bool bufferResponse = this.protocol.MethodAttribute.BufferResponse;
         Stream outputStream = this.protocol.Response.OutputStream;
         if (!bufferResponse)
         {
             outputStream = new BufferedResponseStream(outputStream, 0x4000);
             ((BufferedResponseStream) outputStream).FlushEnabled = false;
         }
         this.protocol.WriteReturns(returnValues, outputStream);
         if (!bufferResponse)
         {
             ((BufferedResponseStream) outputStream).FlushEnabled = true;
             outputStream.Flush();
         }
     }
 }