diff --git a/io/zenoh-transport/src/lib.rs b/io/zenoh-transport/src/lib.rs index e603563b6e..f004b4d511 100644 --- a/io/zenoh-transport/src/lib.rs +++ b/io/zenoh-transport/src/lib.rs @@ -82,7 +82,6 @@ impl TransportEventHandler for DummyTransportEventHandler { /*************************************/ pub trait TransportMulticastEventHandler: Send + Sync { fn new_peer(&self, peer: TransportPeer) -> ZResult>; - fn closing(&self); fn closed(&self); fn as_any(&self) -> &dyn Any; } @@ -95,7 +94,6 @@ impl TransportMulticastEventHandler for DummyTransportMulticastEventHandler { fn new_peer(&self, _peer: TransportPeer) -> ZResult> { Ok(Arc::new(DummyTransportPeerEventHandler)) } - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { self @@ -121,7 +119,6 @@ pub trait TransportPeerEventHandler: Send + Sync { fn handle_message(&self, msg: NetworkMessage) -> ZResult<()>; fn new_link(&self, src: Link); fn del_link(&self, link: Link); - fn closing(&self); fn closed(&self); fn as_any(&self) -> &dyn Any; } @@ -137,7 +134,6 @@ impl TransportPeerEventHandler for DummyTransportPeerEventHandler { fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { diff --git a/io/zenoh-transport/src/multicast/transport.rs b/io/zenoh-transport/src/multicast/transport.rs index 36b9dbbea0..bcccaa9a85 100644 --- a/io/zenoh-transport/src/multicast/transport.rs +++ b/io/zenoh-transport/src/multicast/transport.rs @@ -178,11 +178,7 @@ impl TransportMulticastInner { pub(super) async fn delete(&self) -> ZResult<()> { tracing::debug!("Closing multicast transport on {:?}", self.locator); - // Notify the callback that we are going to close the transport let callback = zwrite!(self.callback).take(); - if let Some(cb) = callback.as_ref() { - cb.closing(); - } // Delete the transport on the manager let _ = self.manager.del_transport_multicast(&self.locator).await; @@ -441,7 +437,6 @@ impl TransportMulticastInner { // TODO(yuyuan): Unify the termination peer.token.cancel(); - peer.handler.closing(); drop(guard); peer.handler.closed(); } diff --git a/io/zenoh-transport/src/unicast/lowlatency/transport.rs b/io/zenoh-transport/src/unicast/lowlatency/transport.rs index c602dcf806..69d88af636 100644 --- a/io/zenoh-transport/src/unicast/lowlatency/transport.rs +++ b/io/zenoh-transport/src/unicast/lowlatency/transport.rs @@ -117,12 +117,7 @@ impl TransportUnicastLowlatency { // to avoid concurrent new_transport and closing/closed notifications let mut a_guard = self.get_alive().await; *a_guard = false; - - // Notify the callback that we are going to close the transport let callback = zwrite!(self.callback).take(); - if let Some(cb) = callback.as_ref() { - cb.closing(); - } // Delete the transport on the manager let _ = self.manager.del_transport_unicast(&self.config.zid).await; diff --git a/io/zenoh-transport/src/unicast/universal/transport.rs b/io/zenoh-transport/src/unicast/universal/transport.rs index f01a4a8f18..fdaadaea66 100644 --- a/io/zenoh-transport/src/unicast/universal/transport.rs +++ b/io/zenoh-transport/src/unicast/universal/transport.rs @@ -129,12 +129,7 @@ impl TransportUnicastUniversal { // to avoid concurrent new_transport and closing/closed notifications let mut a_guard = self.get_alive().await; *a_guard = false; - - // Notify the callback that we are going to close the transport let callback = zwrite!(self.callback).take(); - if let Some(cb) = callback.as_ref() { - cb.closing(); - } // Delete the transport on the manager let _ = self.manager.del_transport_unicast(&self.config.zid).await; diff --git a/io/zenoh-transport/tests/endpoints.rs b/io/zenoh-transport/tests/endpoints.rs index 7fe2f949ef..3ebb015981 100644 --- a/io/zenoh-transport/tests/endpoints.rs +++ b/io/zenoh-transport/tests/endpoints.rs @@ -62,7 +62,6 @@ impl TransportPeerEventHandler for SC { } fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { diff --git a/io/zenoh-transport/tests/multicast_compression.rs b/io/zenoh-transport/tests/multicast_compression.rs index 3b8715c0df..5e31aa6514 100644 --- a/io/zenoh-transport/tests/multicast_compression.rs +++ b/io/zenoh-transport/tests/multicast_compression.rs @@ -111,7 +111,6 @@ mod tests { count: self.count.clone(), })) } - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { @@ -127,7 +126,6 @@ mod tests { fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { diff --git a/io/zenoh-transport/tests/multicast_transport.rs b/io/zenoh-transport/tests/multicast_transport.rs index 664de47ffb..18c8468ecc 100644 --- a/io/zenoh-transport/tests/multicast_transport.rs +++ b/io/zenoh-transport/tests/multicast_transport.rs @@ -110,7 +110,6 @@ mod tests { count: self.count.clone(), })) } - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { @@ -126,7 +125,6 @@ mod tests { fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { diff --git a/io/zenoh-transport/tests/transport_whitelist.rs b/io/zenoh-transport/tests/transport_whitelist.rs index f8428b457d..66f5b58e3b 100644 --- a/io/zenoh-transport/tests/transport_whitelist.rs +++ b/io/zenoh-transport/tests/transport_whitelist.rs @@ -58,7 +58,6 @@ impl TransportPeerEventHandler for SCRouter { fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { diff --git a/io/zenoh-transport/tests/unicast_authenticator.rs b/io/zenoh-transport/tests/unicast_authenticator.rs index a9b22ad5bb..77f025717d 100644 --- a/io/zenoh-transport/tests/unicast_authenticator.rs +++ b/io/zenoh-transport/tests/unicast_authenticator.rs @@ -70,7 +70,6 @@ impl TransportPeerEventHandler for MHRouterAuthenticator { } fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { diff --git a/io/zenoh-transport/tests/unicast_compression.rs b/io/zenoh-transport/tests/unicast_compression.rs index 7b18983b4b..b7f34fbf7f 100644 --- a/io/zenoh-transport/tests/unicast_compression.rs +++ b/io/zenoh-transport/tests/unicast_compression.rs @@ -110,7 +110,6 @@ mod tests { fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { @@ -150,7 +149,6 @@ mod tests { fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { diff --git a/io/zenoh-transport/tests/unicast_concurrent.rs b/io/zenoh-transport/tests/unicast_concurrent.rs index ea124e1c05..410ac33955 100644 --- a/io/zenoh-transport/tests/unicast_concurrent.rs +++ b/io/zenoh-transport/tests/unicast_concurrent.rs @@ -98,7 +98,6 @@ impl TransportPeerEventHandler for MHPeer { fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { diff --git a/io/zenoh-transport/tests/unicast_intermittent.rs b/io/zenoh-transport/tests/unicast_intermittent.rs index 9564eeb865..3e2f8196f4 100644 --- a/io/zenoh-transport/tests/unicast_intermittent.rs +++ b/io/zenoh-transport/tests/unicast_intermittent.rs @@ -138,7 +138,6 @@ impl TransportPeerEventHandler for SCClient { fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { diff --git a/io/zenoh-transport/tests/unicast_priorities.rs b/io/zenoh-transport/tests/unicast_priorities.rs index d71cc845cc..87cf5b5e9e 100644 --- a/io/zenoh-transport/tests/unicast_priorities.rs +++ b/io/zenoh-transport/tests/unicast_priorities.rs @@ -133,7 +133,6 @@ impl TransportPeerEventHandler for SCRouter { fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { @@ -183,7 +182,6 @@ impl TransportPeerEventHandler for SCClient { fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { diff --git a/io/zenoh-transport/tests/unicast_shm.rs b/io/zenoh-transport/tests/unicast_shm.rs index db5f719665..b03771a164 100644 --- a/io/zenoh-transport/tests/unicast_shm.rs +++ b/io/zenoh-transport/tests/unicast_shm.rs @@ -141,7 +141,6 @@ mod tests { fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { diff --git a/io/zenoh-transport/tests/unicast_simultaneous.rs b/io/zenoh-transport/tests/unicast_simultaneous.rs index 248ff2ef53..97d43fc672 100644 --- a/io/zenoh-transport/tests/unicast_simultaneous.rs +++ b/io/zenoh-transport/tests/unicast_simultaneous.rs @@ -126,7 +126,6 @@ mod tests { fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { diff --git a/io/zenoh-transport/tests/unicast_transport.rs b/io/zenoh-transport/tests/unicast_transport.rs index 5a414d664d..e8f473b754 100644 --- a/io/zenoh-transport/tests/unicast_transport.rs +++ b/io/zenoh-transport/tests/unicast_transport.rs @@ -296,7 +296,6 @@ impl TransportPeerEventHandler for SCRouter { fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { @@ -336,7 +335,6 @@ impl TransportPeerEventHandler for SCClient { fn new_link(&self, _link: Link) {} fn del_link(&self, _link: Link) {} - fn closing(&self) {} fn closed(&self) {} fn as_any(&self) -> &dyn Any { diff --git a/zenoh/src/api/admin.rs b/zenoh/src/api/admin.rs index b96fc75dd2..f7bcc06419 100644 --- a/zenoh/src/api/admin.rs +++ b/zenoh/src/api/admin.rs @@ -187,8 +187,6 @@ impl TransportMulticastEventHandler for Handler { } } - fn closing(&self) {} - fn closed(&self) {} fn as_any(&self) -> &dyn std::any::Any { @@ -250,8 +248,6 @@ impl TransportPeerEventHandler for PeerHandler { ); } - fn closing(&self) {} - fn closed(&self) { let info = DataInfo { kind: SampleKind::Delete, diff --git a/zenoh/src/net/primitives/demux.rs b/zenoh/src/net/primitives/demux.rs index f4e5ae074a..8735ed0f32 100644 --- a/zenoh/src/net/primitives/demux.rs +++ b/zenoh/src/net/primitives/demux.rs @@ -100,8 +100,6 @@ impl TransportPeerEventHandler for DeMux { fn del_link(&self, _link: Link) {} - fn closing(&self) {} - fn closed(&self) { self.face.send_close(); } diff --git a/zenoh/src/net/primitives/mux.rs b/zenoh/src/net/primitives/mux.rs index 47067f231e..63376a6d63 100644 --- a/zenoh/src/net/primitives/mux.rs +++ b/zenoh/src/net/primitives/mux.rs @@ -200,9 +200,7 @@ impl Primitives for Mux { } } - fn send_close(&self) { - // self.handler.closing().await; - } + fn send_close(&self) {} } impl EPrimitives for Mux { @@ -530,9 +528,7 @@ impl Primitives for McastMux { } } - fn send_close(&self) { - // self.handler.closing().await; - } + fn send_close(&self) {} } impl EPrimitives for McastMux { diff --git a/zenoh/src/net/runtime/mod.rs b/zenoh/src/net/runtime/mod.rs index 40f241df86..301698eea6 100644 --- a/zenoh/src/net/runtime/mod.rs +++ b/zenoh/src/net/runtime/mod.rs @@ -457,13 +457,6 @@ impl TransportPeerEventHandler for RuntimeSession { } } - fn closing(&self) { - self.main_handler.closing(); - for handler in &self.slave_handlers { - handler.closing(); - } - } - fn closed(&self) { self.main_handler.closed(); Runtime::closed_session(self); @@ -500,12 +493,6 @@ impl TransportMulticastEventHandler for RuntimeMulticastGroup { })) } - fn closing(&self) { - for handler in &self.slave_handlers { - handler.closed(); - } - } - fn closed(&self) { for handler in &self.slave_handlers { handler.closed(); @@ -541,13 +528,6 @@ impl TransportPeerEventHandler for RuntimeMulticastSession { } } - fn closing(&self) { - self.main_handler.closing(); - for handler in &self.slave_handlers { - handler.closing(); - } - } - fn closed(&self) { self.main_handler.closed(); for handler in &self.slave_handlers {