File tree 5 files changed +53
-7
lines changed
5 files changed +53
-7
lines changed Original file line number Diff line number Diff line change @@ -1242,14 +1242,29 @@ where
1242
1242
/// by this client.
1243
1243
///
1244
1244
/// This limit is configured by the server peer by sending the
1245
- /// [`SETTINGS_MAX_CONCURRENT_STREAMS` parameter][settings ] in a `SETTINGS`
1246
- /// frame. This method returns the currently acknowledged value recieved
1247
- /// from the remote.
1245
+ /// [`SETTINGS_MAX_CONCURRENT_STREAMS` parameter][1 ] in a `SETTINGS` frame.
1246
+ /// This method returns the currently acknowledged value recieved from the
1247
+ /// remote.
1248
1248
///
1249
1249
/// [settings]: https://tools.ietf.org/html/rfc7540#section-5.1.2
1250
1250
pub fn max_concurrent_send_streams ( & self ) -> usize {
1251
1251
self . inner . max_send_streams ( )
1252
1252
}
1253
+
1254
+ /// Returns the maximum number of concurrent streams that may be initiated
1255
+ /// by the server on this connection.
1256
+ ///
1257
+ /// This returns the value of the [`SETTINGS_MAX_CONCURRENT_STREAMS`
1258
+ /// parameter][1] sent in a `SETTINGS` frame that has been
1259
+ /// acknowledged by the remote peer. The value to be sent is configured by
1260
+ /// the [`Builder::max_concurrent_streams`][2] method before handshaking
1261
+ /// with the remote peer.
1262
+ ///
1263
+ /// [1]: https://tools.ietf.org/html/rfc7540#section-5.1.2
1264
+ /// [2]: ../struct.Builder.html#method.max_concurrent_streams
1265
+ pub fn max_concurrent_recv_streams ( & self ) -> usize {
1266
+ self . inner . max_recv_streams ( )
1267
+ }
1253
1268
}
1254
1269
1255
1270
impl < T , B > Future for Connection < T , B >
Original file line number Diff line number Diff line change @@ -153,6 +153,12 @@ where
153
153
self . inner . streams . max_send_streams ( )
154
154
}
155
155
156
+ /// Returns the maximum number of concurrent streams that may be initiated
157
+ /// by the remote peer.
158
+ pub ( crate ) fn max_recv_streams ( & self ) -> usize {
159
+ self . streams . max_recv_streams ( )
160
+ }
161
+
156
162
/// Returns `Ready` when the connection is ready to receive a frame.
157
163
///
158
164
/// Returns `RecvError` as this may raise errors that are caused by delayed
Original file line number Diff line number Diff line change @@ -173,6 +173,12 @@ impl Counts {
173
173
self . max_send_streams
174
174
}
175
175
176
+ /// Returns the maximum number of streams that can be initiated by the
177
+ /// remote peer.
178
+ pub ( crate ) fn max_recv_streams ( & self ) -> usize {
179
+ self . max_recv_streams
180
+ }
181
+
176
182
fn dec_num_streams ( & mut self , stream : & mut store:: Ptr ) {
177
183
assert ! ( stream. is_counted) ;
178
184
Original file line number Diff line number Diff line change @@ -943,6 +943,10 @@ where
943
943
self . inner . lock ( ) . unwrap ( ) . counts . max_send_streams ( )
944
944
}
945
945
946
+ pub ( crate ) fn max_recv_streams ( & self ) -> usize {
947
+ self . inner . lock ( ) . unwrap ( ) . counts . max_recv_streams ( )
948
+ }
949
+
946
950
#[ cfg( feature = "unstable" ) ]
947
951
pub fn num_active_streams ( & self ) -> usize {
948
952
let me = self . inner . lock ( ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -534,14 +534,29 @@ where
534
534
/// by the server on this connection.
535
535
///
536
536
/// This limit is configured by the client peer by sending the
537
- /// [`SETTINGS_MAX_CONCURRENT_STREAMS` parameter][settings ] in a `SETTINGS`
538
- /// frame. This method returns the currently acknowledged value recieved
539
- /// from the remote.
537
+ /// [`SETTINGS_MAX_CONCURRENT_STREAMS` parameter][1 ] in a `SETTINGS` frame.
538
+ /// This method returns the currently acknowledged value recieved from the
539
+ /// remote.
540
540
///
541
- /// [settings ]: https://tools.ietf.org/html/rfc7540#section-5.1.2
541
+ /// [1 ]: https://tools.ietf.org/html/rfc7540#section-5.1.2
542
542
pub fn max_concurrent_send_streams ( & self ) -> usize {
543
543
self . connection . max_send_streams ( )
544
544
}
545
+
546
+ /// Returns the maximum number of concurrent streams that may be initiated
547
+ /// by the client on this connection.
548
+ ///
549
+ /// This returns the value of the [`SETTINGS_MAX_CONCURRENT_STREAMS`
550
+ /// parameter][1] sent in a `SETTINGS` frame that has been
551
+ /// acknowledged by the remote peer. The value to be sent is configured by
552
+ /// the [`Builder::max_concurrent_streams`][2] method before handshaking
553
+ /// with the remote peer.
554
+ ///
555
+ /// [1]: https://tools.ietf.org/html/rfc7540#section-5.1.2
556
+ /// [2]: ../struct.Builder.html#method.max_concurrent_streams
557
+ pub fn max_concurrent_recv_streams ( & self ) -> usize {
558
+ self . connection . max_recv_streams ( )
559
+ }
545
560
}
546
561
547
562
#[ cfg( feature = "stream" ) ]
You can’t perform that action at this time.
0 commit comments