コード例 #1
0
        /// <summary>
        /// Creates a new request.
        /// </summary>
        internal FastCGIRequest(int requestId, FastCGIConnection connection, bool keepAlive)
        {
            _requestId  = requestId;
            _connection = connection;
            _keepAlive  = keepAlive;

            _body           = new BufferData();
            _responseBuffer = new BufferData();
            _parameters     = new Dictionary <string, string>();
        }
コード例 #2
0
        /// <summary>
        /// End this request.
        /// </summary>
        public void End()
        {
            if (_connection != null)
            {
                if (!_responseBuffer.IsEmpty())
                {
                    _connection.SendStdout(_requestId, _responseBuffer);
                    _responseBuffer.Clear();
                }
                // Last empty response
                _connection.SendStdout(_requestId, _responseBuffer);
                _connection.SendEndRequest(_requestId);
                _connection.Flush();
                if (!_keepAlive)
                {
                    _connection.Close();
                }

                // Clear connection after closed.
                _connection = null;
            }
        }
コード例 #3
0
ファイル: FastCGIServer.cs プロジェクト: tiwb/AngeIO
 private void OnSocketConnected(TcpSocket s)
 {
     var conn = new FastCGIConnection(this, s);
 }