mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-14 10:31:21 +00:00
core/connection/listeners: Create event on remove_listener (#2261)
Create a `ListenersEvent::Closed` when a listener is removed via `Swarm::remove_listener`. This makes it more consistent with `Swarm::listen_on`, and also informs the Swarm about the associated expired addresses. Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
@ -324,8 +324,9 @@ where
|
||||
|
||||
/// Remove some listener.
|
||||
///
|
||||
/// Returns `Ok(())` if there was a listener with this ID.
|
||||
pub fn remove_listener(&mut self, id: ListenerId) -> Result<(), ()> {
|
||||
/// Returns `true` if there was a listener with this ID, `false`
|
||||
/// otherwise.
|
||||
pub fn remove_listener(&mut self, id: ListenerId) -> bool {
|
||||
self.network.remove_listener(id)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user