File tree 5 files changed +28
-0
lines changed
5 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -1228,6 +1228,12 @@ where
1228
1228
pub fn ping_pong ( & mut self ) -> Option < PingPong > {
1229
1229
self . inner . take_user_pings ( ) . map ( PingPong :: new)
1230
1230
}
1231
+
1232
+ /// Returns the maximum number of concurrent streams that may be initiated
1233
+ /// by this client.
1234
+ pub fn max_concurrent_send_streams ( & self ) -> usize {
1235
+ self . inner . max_send_streams ( )
1236
+ }
1231
1237
}
1232
1238
1233
1239
impl < T , B > Future for Connection < T , B >
Original file line number Diff line number Diff line change @@ -120,6 +120,12 @@ where
120
120
self . settings . send_settings ( settings)
121
121
}
122
122
123
+ /// Returns the maximum number of concurrent streams that may be initiated
124
+ /// by this peer.
125
+ pub ( crate ) fn max_send_streams ( & self ) -> usize {
126
+ self . streams . max_send_streams ( )
127
+ }
128
+
123
129
/// Returns `Ready` when the connection is ready to receive a frame.
124
130
///
125
131
/// Returns `RecvError` as this may raise errors that are caused by delayed
Original file line number Diff line number Diff line change @@ -167,6 +167,12 @@ impl Counts {
167
167
}
168
168
}
169
169
170
+ /// Returns the maximum number of streams that can be initiated by this
171
+ /// peer.
172
+ pub ( crate ) fn max_send_streams ( & self ) -> usize {
173
+ self . max_send_streams
174
+ }
175
+
170
176
fn dec_num_streams ( & mut self , stream : & mut store:: Ptr ) {
171
177
assert ! ( stream. is_counted) ;
172
178
Original file line number Diff line number Diff line change @@ -836,6 +836,10 @@ where
836
836
Ok ( ( ) )
837
837
}
838
838
839
+ pub ( crate ) fn max_send_streams ( & self ) -> usize {
840
+ self . inner . lock ( ) . unwrap ( ) . counts . max_send_streams ( )
841
+ }
842
+
839
843
#[ cfg( feature = "unstable" ) ]
840
844
pub fn num_active_streams ( & self ) -> usize {
841
845
let me = self . inner . lock ( ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -529,6 +529,12 @@ where
529
529
pub fn ping_pong ( & mut self ) -> Option < PingPong > {
530
530
self . connection . take_user_pings ( ) . map ( PingPong :: new)
531
531
}
532
+
533
+ /// Returns the maximum number of concurrent streams that may be initiated
534
+ /// by the server on this connection.
535
+ pub fn max_concurrent_send_streams ( & self ) -> usize {
536
+ self . connection . max_send_streams ( )
537
+ }
532
538
}
533
539
534
540
#[ cfg( feature = "stream" ) ]
You can’t perform that action at this time.
0 commit comments