Skip to content

Commit

Permalink
Rename UnicastListener to ListenerUnicastIP for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc committed Feb 21, 2024
1 parent 0a85d90 commit a417356
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 23 deletions.
22 changes: 11 additions & 11 deletions io/zenoh-link-commons/src/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<AtomicBool>,
signal: Signal,
handle: JoinHandle<ZResult<()>>,
}

impl UnicastListener {
impl ListenerUnicastIP {
fn new(
endpoint: EndPoint,
active: Arc<AtomicBool>,
signal: Signal,
handle: JoinHandle<ZResult<()>>,
) -> UnicastListener {
UnicastListener {
) -> ListenerUnicastIP {
ListenerUnicastIP {
endpoint,
active,
signal,
Expand All @@ -46,13 +46,13 @@ impl UnicastListener {
}
}

pub struct UnicastListeners {
listeners: Arc<RwLock<HashMap<SocketAddr, UnicastListener>>>,
pub struct ListenersUnicastIP {
listeners: Arc<RwLock<HashMap<SocketAddr, ListenerUnicastIP>>>,
}

impl UnicastListeners {
pub fn new() -> UnicastListeners {
UnicastListeners {
impl ListenersUnicastIP {
pub fn new() -> ListenersUnicastIP {
ListenersUnicastIP {
listeners: Arc::new(RwLock::new(HashMap::new())),
}
}
Expand All @@ -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(())
Expand Down Expand Up @@ -134,7 +134,7 @@ impl UnicastListeners {
}
}

impl Default for UnicastListeners {
impl Default for ListenersUnicastIP {
fn default() -> Self {
Self::new()
}
Expand Down
7 changes: 4 additions & 3 deletions io/zenoh-links/zenoh-link-quic/src/unicast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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(),
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions io/zenoh-links/zenoh-link-tcp/src/unicast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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(),
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions io/zenoh-links/zenoh-link-tls/src/unicast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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(),
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions io/zenoh-links/zenoh-link-udp/src/unicast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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(),
}
}
}
Expand Down

0 comments on commit a417356

Please sign in to comment.