Allow StreamMuxer to notify changes in the address (#1621)

* Allow StreamMuxer to notify changes in the address

* Fix doc link

* Revert accidental rename

* Other accidental rename

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
This commit is contained in:
Pierre Krieger
2020-06-30 17:10:53 +02:00
committed by GitHub
parent d5b26359bb
commit 826f5130cd
23 changed files with 330 additions and 57 deletions

View File

@ -53,6 +53,7 @@ pub use crate::upgrade::{
use libp2p_core::{
ConnectedPoint,
Multiaddr,
PeerId,
upgrade::{self, UpgradeError},
};
@ -140,6 +141,9 @@ pub trait ProtocolsHandler: Send + 'static {
/// Injects an event coming from the outside in the handler.
fn inject_event(&mut self, event: Self::InEvent);
/// Notifies the handler of a change in the address of the remote.
fn inject_address_change(&mut self, _new_address: &Multiaddr) {}
/// Indicates to the handler that upgrading an outbound substream to the given protocol has failed.
fn inject_dial_upgrade_error(
&mut self,