/// <summary>
        /// Opens the stream in current session.
        /// </summary>
        /// <param name="id">the stream id.</param>
        /// <param name="headers">The S+M headers.</param>
        /// <param name="isFinal">the final flag.</param>
        /// <returns>The Stream.</returns>
        private Http2Stream OpenStream(int id, ProtocolHeaders headers, bool isFinal)
        {
            if (id <= this.lastSeenStreamId)
            {
                this.End(StatusCode.ProtocolError);
                return null;
            }

            this.lastSeenStreamId = id;

            // don't have to wait for stream opening
            Http2Stream stream = new Http2Stream(id, this);

            this.streams.Add(stream);

            stream.OnClose += this.OnCloseStream;
            stream.Open(headers, isFinal);

            if (this.OnStreamOpened != null)
            {
                this.OnStreamOpened(this, new StreamEventArgs(stream));
            }

            return stream;
        }