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 @@ -1233,14 +1233,29 @@ where
1233
1233
/// by this client.
1234
1234
///
1235
1235
/// This limit is configured by the server peer by sending the
1236
- /// [`SETTINGS_MAX_CONCURRENT_STREAMS` parameter][settings ] in a `SETTINGS`
1237
- /// frame. This method returns the currently acknowledged value recieved
1238
- /// from the remote.
1236
+ /// [`SETTINGS_MAX_CONCURRENT_STREAMS` parameter][1 ] in a `SETTINGS` frame.
1237
+ /// This method returns the currently acknowledged value recieved from the
1238
+ /// remote.
1239
1239
///
1240
1240
/// [settings]: https://tools.ietf.org/html/rfc7540#section-5.1.2
1241
1241
pub fn max_concurrent_send_streams ( & self ) -> usize {
1242
1242
self . inner . max_send_streams ( )
1243
1243
}
1244
+
1245
+ /// Returns the maximum number of concurrent streams that may be initiated
1246
+ /// by the server on this connection.
1247
+ ///
1248
+ /// This returns the value of the [`SETTINGS_MAX_CONCURRENT_STREAMS`
1249
+ /// parameter][1] sent in a `SETTINGS` frame that has been
1250
+ /// acknowledged by the remote peer. The value to be sent is configured by
1251
+ /// the [`Builder::max_concurrent_streams`][2] method before handshaking
1252
+ /// with the remote peer.
1253
+ ///
1254
+ /// [1]: https://tools.ietf.org/html/rfc7540#section-5.1.2
1255
+ /// [2]: ../struct.Builder.html#method.max_concurrent_streams
1256
+ pub fn max_concurrent_recv_streams ( & self ) -> usize {
1257
+ self . inner . max_recv_streams ( )
1258
+ }
1244
1259
}
1245
1260
1246
1261
impl < T , B > Future for Connection < T , B >
Original file line number Diff line number Diff line change @@ -126,6 +126,12 @@ where
126
126
self . streams . max_send_streams ( )
127
127
}
128
128
129
+ /// Returns the maximum number of concurrent streams that may be initiated
130
+ /// by the remote peer.
131
+ pub ( crate ) fn max_recv_streams ( & self ) -> usize {
132
+ self . streams . max_recv_streams ( )
133
+ }
134
+
129
135
/// Returns `Ready` when the connection is ready to receive a frame.
130
136
///
131
137
/// 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 @@ -840,6 +840,10 @@ where
840
840
self . inner . lock ( ) . unwrap ( ) . counts . max_send_streams ( )
841
841
}
842
842
843
+ pub ( crate ) fn max_recv_streams ( & self ) -> usize {
844
+ self . inner . lock ( ) . unwrap ( ) . counts . max_recv_streams ( )
845
+ }
846
+
843
847
#[ cfg( feature = "unstable" ) ]
844
848
pub fn num_active_streams ( & self ) -> usize {
845
849
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