Skip to content

Commit

Permalink
Use max_inbound_streams for ping handler
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseizinger committed Oct 6, 2022
1 parent 534c3f6 commit a6bd2e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions protocols/ping/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ impl ConnectionHandler for Handler {
SubstreamProtocol::new(ReadyUpgrade::new(PROTOCOL_NAME), ())
}

fn max_inbound_streams(&self) -> usize {
1 // There is only ever one active inbound stream.
}

fn inject_fully_negotiated_inbound(&mut self, stream: NegotiatedSubstream, (): ()) {
self.inbound = Some(protocol::recv_ping(stream).boxed());
}
Expand Down

0 comments on commit a6bd2e4

Please sign in to comment.