Exemplo n.º 1
0
        /// <summary>
        /// Closes this request.
        /// </summary>
        public void Close()
        {
            if (IsOpen)
            {
                WriteResponse(new byte[0]);
                var record = Record.CreateEndRequest(RequestId);
                record.Send(ResponseStream);
                ResponseStream.Flush();
                if (!KeepAlive)
                {
                    // If the response stream is a regular FCGIStream and KeepAlive is false, disconnect it
                    var fcgiStream = ResponseStream as FCGIStream;
                    if (fcgiStream != null)
                    {
                        fcgiStream.Disconnect();
                    }

                    if (ManagingApp != null)
                    {
                        ManagingApp.ConnectionClosed(ResponseStream as FCGIStream);
                    }
                }

                if (ManagingApp != null)
                {
                    ManagingApp.RequestClosed(this);
                }
            }
            IsOpen = false;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Closes this request.
        /// </summary>
        public void Close()
        {
            WriteResponse(new byte[0]);
            var record = Record.CreateEndRequest(RequestId);

            record.Send(ResponseStream);

            if (ManagingApp != null)
            {
                ManagingApp.RequestClosed(this);
                if (!KeepAlive)
                {
                    ManagingApp.ConnectionClosed(ResponseStream as FCGIStream);
                }
            }

            if (!KeepAlive)
            {
                ResponseStream.Close();
            }
        }