diff --git a/io/zenoh-link-commons/src/listener.rs b/io/zenoh-link-commons/src/listener.rs index a9ed7c65cc..1d5d7bb172 100644 --- a/io/zenoh-link-commons/src/listener.rs +++ b/io/zenoh-link-commons/src/listener.rs @@ -23,21 +23,21 @@ use zenoh_protocol::core::{EndPoint, Locator}; use zenoh_result::{zerror, ZResult}; use zenoh_sync::Signal; -pub struct UnicastListener { +pub struct ListenerUnicastIP { endpoint: EndPoint, active: Arc, signal: Signal, handle: JoinHandle>, } -impl UnicastListener { +impl ListenerUnicastIP { fn new( endpoint: EndPoint, active: Arc, signal: Signal, handle: JoinHandle>, - ) -> UnicastListener { - UnicastListener { + ) -> ListenerUnicastIP { + ListenerUnicastIP { endpoint, active, signal, @@ -46,13 +46,13 @@ impl UnicastListener { } } -pub struct UnicastListeners { - listeners: Arc>>, +pub struct ListenersUnicastIP { + listeners: Arc>>, } -impl UnicastListeners { - pub fn new() -> UnicastListeners { - UnicastListeners { +impl ListenersUnicastIP { + pub fn new() -> ListenersUnicastIP { + ListenersUnicastIP { listeners: Arc::new(RwLock::new(HashMap::new())), } } @@ -75,7 +75,7 @@ impl UnicastListeners { res }); - let listener = UnicastListener::new(endpoint, active, signal, wraphandle); + let listener = ListenerUnicastIP::new(endpoint, active, signal, wraphandle); // Update the list of active listeners on the manager listeners.insert(addr, listener); Ok(()) @@ -134,7 +134,7 @@ impl UnicastListeners { } } -impl Default for UnicastListeners { +impl Default for ListenersUnicastIP { fn default() -> Self { Self::new() } diff --git a/io/zenoh-links/zenoh-link-quic/src/unicast.rs b/io/zenoh-links/zenoh-link-quic/src/unicast.rs index a7e45f1ef8..fe18e24465 100644 --- a/io/zenoh-links/zenoh-link-quic/src/unicast.rs +++ b/io/zenoh-links/zenoh-link-quic/src/unicast.rs @@ -32,7 +32,8 @@ use std::sync::Arc; use std::time::Duration; use zenoh_core::zasynclock; use zenoh_link_commons::{ - LinkManagerUnicastTrait, LinkUnicast, LinkUnicastTrait, NewLinkChannelSender, UnicastListeners, + LinkManagerUnicastTrait, LinkUnicast, LinkUnicastTrait, ListenersUnicastIP, + NewLinkChannelSender, }; use zenoh_protocol::core::{EndPoint, Locator}; use zenoh_result::{bail, zerror, ZError, ZResult}; @@ -188,14 +189,14 @@ impl fmt::Debug for LinkUnicastQuic { pub struct LinkManagerUnicastQuic { manager: NewLinkChannelSender, - listeners: UnicastListeners, + listeners: ListenersUnicastIP, } impl LinkManagerUnicastQuic { pub fn new(manager: NewLinkChannelSender) -> Self { Self { manager, - listeners: UnicastListeners::new(), + listeners: ListenersUnicastIP::new(), } } } diff --git a/io/zenoh-links/zenoh-link-tcp/src/unicast.rs b/io/zenoh-links/zenoh-link-tcp/src/unicast.rs index b1e9a47405..ae88d54db8 100644 --- a/io/zenoh-links/zenoh-link-tcp/src/unicast.rs +++ b/io/zenoh-links/zenoh-link-tcp/src/unicast.rs @@ -22,7 +22,8 @@ use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use std::time::Duration; use zenoh_link_commons::{ - LinkManagerUnicastTrait, LinkUnicast, LinkUnicastTrait, NewLinkChannelSender, UnicastListeners, + LinkManagerUnicastTrait, LinkUnicast, LinkUnicastTrait, ListenersUnicastIP, + NewLinkChannelSender, }; use zenoh_protocol::core::{EndPoint, Locator}; use zenoh_result::{bail, zerror, Error as ZError, ZResult}; @@ -199,14 +200,14 @@ impl fmt::Debug for LinkUnicastTcp { pub struct LinkManagerUnicastTcp { manager: NewLinkChannelSender, - listeners: UnicastListeners, + listeners: ListenersUnicastIP, } impl LinkManagerUnicastTcp { pub fn new(manager: NewLinkChannelSender) -> Self { Self { manager, - listeners: UnicastListeners::new(), + listeners: ListenersUnicastIP::new(), } } } diff --git a/io/zenoh-links/zenoh-link-tls/src/unicast.rs b/io/zenoh-links/zenoh-link-tls/src/unicast.rs index eec28ebca4..abf5b13bbe 100644 --- a/io/zenoh-links/zenoh-link-tls/src/unicast.rs +++ b/io/zenoh-links/zenoh-link-tls/src/unicast.rs @@ -46,7 +46,8 @@ use webpki::{ }; use zenoh_core::zasynclock; use zenoh_link_commons::{ - LinkManagerUnicastTrait, LinkUnicast, LinkUnicastTrait, NewLinkChannelSender, UnicastListeners, + LinkManagerUnicastTrait, LinkUnicast, LinkUnicastTrait, ListenersUnicastIP, + NewLinkChannelSender, }; use zenoh_protocol::core::endpoint::Config; use zenoh_protocol::core::{EndPoint, Locator}; @@ -237,14 +238,14 @@ impl fmt::Debug for LinkUnicastTls { pub struct LinkManagerUnicastTls { manager: NewLinkChannelSender, - listeners: UnicastListeners, + listeners: ListenersUnicastIP, } impl LinkManagerUnicastTls { pub fn new(manager: NewLinkChannelSender) -> Self { Self { manager, - listeners: UnicastListeners::new(), + listeners: ListenersUnicastIP::new(), } } } diff --git a/io/zenoh-links/zenoh-link-udp/src/unicast.rs b/io/zenoh-links/zenoh-link-udp/src/unicast.rs index 76ca2e221b..71fd56926c 100644 --- a/io/zenoh-links/zenoh-link-udp/src/unicast.rs +++ b/io/zenoh-links/zenoh-link-udp/src/unicast.rs @@ -28,7 +28,7 @@ use std::time::Duration; use zenoh_core::{zasynclock, zlock}; use zenoh_link_commons::{ ConstructibleLinkManagerUnicast, LinkManagerUnicastTrait, LinkUnicast, LinkUnicastTrait, - NewLinkChannelSender, UnicastListeners, + ListenersUnicastIP, NewLinkChannelSender, }; use zenoh_protocol::core::{EndPoint, Locator}; use zenoh_result::{bail, zerror, Error as ZError, ZResult}; @@ -257,14 +257,14 @@ impl fmt::Debug for LinkUnicastUdp { pub struct LinkManagerUnicastUdp { manager: NewLinkChannelSender, - listeners: UnicastListeners, + listeners: ListenersUnicastIP, } impl LinkManagerUnicastUdp { pub fn new(manager: NewLinkChannelSender) -> Self { Self { manager, - listeners: UnicastListeners::new(), + listeners: ListenersUnicastIP::new(), } } }