mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-17 12:01:23 +00:00
Add ProtocolsHandler::InboundOpenInfo
. (#1714)
* Add `ProtocolsHandler::InboundOpenInfo`. * Update swarm/src/protocols_handler/multi.rs Co-authored-by: Roman Borschel <romanb@users.noreply.github.com> * Update CHANGELOGs and versions. Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
This commit is contained in:
@ -207,12 +207,13 @@ impl ProtocolsHandler for PingHandler {
|
||||
type InboundProtocol = protocol::Ping;
|
||||
type OutboundProtocol = protocol::Ping;
|
||||
type OutboundOpenInfo = ();
|
||||
type InboundOpenInfo = ();
|
||||
|
||||
fn listen_protocol(&self) -> SubstreamProtocol<protocol::Ping> {
|
||||
SubstreamProtocol::new(protocol::Ping)
|
||||
fn listen_protocol(&self) -> SubstreamProtocol<protocol::Ping, ()> {
|
||||
SubstreamProtocol::new(protocol::Ping, ())
|
||||
}
|
||||
|
||||
fn inject_fully_negotiated_inbound(&mut self, stream: NegotiatedSubstream) {
|
||||
fn inject_fully_negotiated_inbound(&mut self, stream: NegotiatedSubstream, (): ()) {
|
||||
self.inbound = Some(protocol::recv_ping(stream).boxed());
|
||||
}
|
||||
|
||||
@ -329,11 +330,10 @@ impl ProtocolsHandler for PingHandler {
|
||||
}
|
||||
None => {
|
||||
self.outbound = Some(PingState::OpenStream);
|
||||
let protocol = SubstreamProtocol::new(protocol::Ping)
|
||||
let protocol = SubstreamProtocol::new(protocol::Ping, ())
|
||||
.with_timeout(self.config.timeout);
|
||||
return Poll::Ready(ProtocolsHandlerEvent::OutboundSubstreamRequest {
|
||||
protocol,
|
||||
info: (),
|
||||
protocol
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user