示例#1
0
 internal ListenerWritabilityMonitor(DefaultHttp2RemoteFlowController controller, IHttp2RemoteFlowControllerListener listener)
     : base(controller)
 {
     _listener = listener;
 }
示例#2
0
 public DefaultHttp2RemoteFlowController(IHttp2Connection connection, IHttp2RemoteFlowControllerListener listener)
     : this(connection, new WeightedFairQueueByteDistributor(connection), listener)
 {
 }
示例#3
0
        public DefaultHttp2RemoteFlowController(IHttp2Connection connection, IStreamByteDistributor streamByteDistributor, IHttp2RemoteFlowControllerListener listener)
        {
            if (connection is null)
            {
                ThrowHelper.ThrowArgumentNullException(ExceptionArgument.connection);
            }
            if (streamByteDistributor is null)
            {
                ThrowHelper.ThrowArgumentNullException(ExceptionArgument.streamByteDistributor);
            }
            _connection            = connection;
            _streamByteDistributor = streamByteDistributor;

            // Add a flow state for the connection.
            _stateKey        = connection.NewKey();
            _connectionState = new FlowState(this, _connection.ConnectionStream);
            _ = connection.ConnectionStream.SetProperty(_stateKey, _connectionState);

            // Monitor may depend upon connectionState, and so initialize after connectionState
            Listener(listener);
            _monitor.WindowSize(_connectionState, _initialWindowSize);

            // Register for notification of new streams.
            connection.AddListener(this);
        }
示例#4
0
 public void Listener(IHttp2RemoteFlowControllerListener listener)
 {
     _monitor = listener is null ? new WritabilityMonitor(this) : new ListenerWritabilityMonitor(this, listener);
 }