mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-16 11:31:22 +00:00
swarm/: Limit negotiating inbound substreams per connection (#2697)
This limit is shared across all `ConnectionHandler`s on a single connection. It only enforces a limit on the number of negotiating substreams. Once negotiated a `ConnectionHandler` manages the lifecycle of the substream and has to enforce limits themselves.
This commit is contained in:
@ -1364,6 +1364,14 @@ where
|
||||
self
|
||||
}
|
||||
|
||||
/// The maximum number of inbound streams concurrently negotiating on a connection.
|
||||
///
|
||||
/// See [`PoolConfig::with_max_negotiating_inbound_streams`].
|
||||
pub fn max_negotiating_inbound_streams(mut self, v: usize) -> Self {
|
||||
self.pool_config = self.pool_config.with_max_negotiating_inbound_streams(v);
|
||||
self
|
||||
}
|
||||
|
||||
/// Builds a `Swarm` with the current configuration.
|
||||
pub fn build(mut self) -> Swarm<TBehaviour> {
|
||||
let supported_protocols = self
|
||||
|
Reference in New Issue
Block a user