99 * instance
1010 */
1111public class Http2StreamManagerOptions {
12- public static final int DEFAULT_MAX_WINDOW_SIZE = Integer .MAX_VALUE ;
1312 public static final int DEFAULT_MAX = Integer .MAX_VALUE ;
14- public static final int DEFAULT_MAX_CONNECTIONS = 2 ;
1513 public static final int DEFAULT_CONNECTION_PING_TIMEOUT_MS = 3000 ;
1614 private static final String HTTPS = "https" ;
1715
@@ -20,6 +18,7 @@ public class Http2StreamManagerOptions {
2018 private int idealConcurrentStreamsPerConnection = 100 ;
2119 private boolean connectionManualWindowManagement = false ;
2220 private int maxConcurrentStreamsPerConnection = DEFAULT_MAX ;
21+ private int maxConcurrentStreams = 0 ;
2322
2423 private boolean priorKnowledge = false ;
2524 private boolean closeConnectionOnServerError = false ;
@@ -108,6 +107,28 @@ public int getMaxConcurrentStreamsPerConnection() {
108107 return maxConcurrentStreamsPerConnection ;
109108 }
110109
110+ /**
111+ * The max number of concurrent streams that can be active across all connections
112+ * at the same time. 0 means no limit (default). When this limit is reached, the
113+ * stream manager will wait for existing streams to complete before creating new
114+ * ones, even if connections have available capacity.
115+ *
116+ * @param maxConcurrentStreams The max number of concurrent streams across all connections
117+ * @return this
118+ */
119+ public Http2StreamManagerOptions withMaxConcurrentStreams (int maxConcurrentStreams ) {
120+ this .maxConcurrentStreams = maxConcurrentStreams ;
121+ return this ;
122+ }
123+
124+ /**
125+ * @return The max number of concurrent streams across all connections.
126+ * 0 means no limit (default).
127+ */
128+ public int getMaxConcurrentStreams () {
129+ return maxConcurrentStreams ;
130+ }
131+
111132 /**
112133 * @return The connection level manual flow control enabled or not.
113134 */
0 commit comments