HTTP2 protocol.
Inheritance: IDisposable
コード例 #1
0
            public HandshakeHeadersBlock(Http2Protocol protocol, Uri uri)
            {
                this._protocol = protocol;
                this.uri = uri;

                HandshakeHeaders = new List<string>(10);
            }
コード例 #2
0
        public HandshakeHeadersBlock(Http2Protocol protocol, Uri uri)
        {
            this._protocol = protocol;
            this.uri       = uri;

            HandshakeHeaders = new List <string>(10);
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProtocolSession"/> class.
        /// </summary>
        /// <param name="uri">the URI.</param>
        /// <param name="isServer">the Server flag.</param>
        /// <param name="options">Session options.</param>
        public ProtocolSession(SecureSocket socket, ProtocolOptions options)
        {
            this.isFlowControlEnabled = options.IsFlowControl;
            this.streams       = new List <Http2Stream>();
            this.closedStreams = new List <Http2Stream>();
            this.isServer      = true;

            this.CurrentWindowBalanceToServer   = 512;
            this.CurrentWindowBalanceFromServer = 256;

            this.protocol = new Http2Protocol(socket, this, options);
            this.protocol.OnSessionFrame += this.OnSessionFrame;
            this.protocol.OnClose        += this.OnProtocolClose;
            this.protocol.OnOpen         += this.OnProtocolOpen;
            this.protocol.OnError        += this.OnProtocolError;
            this.protocol.OnPing         += this.OnProtocolPing;

            if (options.UseCompression)
            {
                this.Protocol.SetProcessors(new List <IMessageProcessor> {
                    new CompressionProcessor()
                });
            }
        }
コード例 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProtocolSession"/> class.
        /// </summary>
        /// <param name="uri">the URI.</param>
        /// <param name="isServer">the Server flag.</param>
        /// <param name="options">Session options.</param>
        public ProtocolSession(Uri uri, bool isServer, ProtocolOptions options)
        {
            this.isFlowControlEnabled = options.IsFlowControl;
            this.streams = new List<Http2Stream>();
            this.closedStreams = new List<Http2Stream>();
            this.isServer = isServer;

            this.CurrentWindowBalanceToServer = 512;
            this.CurrentWindowBalanceFromServer = 256;

            this.protocol = new Http2Protocol(uri, this, options);
            this.protocol.OnSessionFrame += this.OnSessionFrame;
            this.protocol.OnClose += this.OnProtocolClose;
            this.protocol.OnOpen += this.OnProtocolOpen;
            this.protocol.OnError += this.OnProtocolError;
            this.protocol.OnPing += this.OnProtocolPing;

            if (options.UseCompression)
            {
                this.Protocol.SetProcessors(new List<IMessageProcessor> { new CompressionProcessor() });
            }
        }