Add NetworkBehaviour methods for listened addresses (#1061)

This commit is contained in:
Pierre Krieger
2019-04-16 15:36:08 +02:00
committed by GitHub
parent 889f003a3f
commit 9b6336672b
4 changed files with 61 additions and 8 deletions

View File

@ -80,6 +80,15 @@ pub trait NetworkBehaviour {
fn inject_dial_failure(&mut self, _peer_id: &PeerId) {
}
/// Indicates to the behaviour that we have started listening on a new multiaddr.
fn inject_new_listen_addr(&mut self, _addr: &Multiaddr) {
}
/// Indicates to the behaviour that a new multiaddr we were listening on has expired,
/// which means that we are no longer listening in it.
fn inject_expired_listen_addr(&mut self, _addr: &Multiaddr) {
}
/// Polls for things that swarm should do.
///
/// This API mimics the API of the `Stream` trait.