Repository: eclipse-fog05/fog05 (language: python)

Issue:
[BUG] Compile error with Rust 1.55.0 (stable)
**Describe the bug**
I checked out the fog05 repository and tried to build it on Ubuntu 20.04.  shared_memory v 0.11.4 fails to compile. This package is a dependency of zenoh.

`
   Compiling shared_memory v0.11.4
error[E0164]: expected tuple struct or tuple variant, found associated function `nix::Error::Sys`
  --> /home/sjames/.cargo/registry/src/github.com-1ecc6299db9ec823/shared_memory-0.11.4/src/unix.rs:87:13
   |
87 |         Err(nix::Error::Sys(Errno::EEXIST)) => return Err(ShmemError::MappingIdExists),
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `fn` calls are not allowed in patterns
   |
   = help: for more information, visit https://doc.rust-lang.org/book/ch18-00-patterns.html

`
**To Reproduce**
Steps to reproduce the behavior:
1. Check out fog05 github repo
2. cargo build

**Expected behavior**
Build must succeed

**Desktop (please complete the following information):**
 - OS: Linux
 - Version Ubuntu 20.04




Discussion / hints:
Hi @sjames,

Eclipse fog05 does not build with rust stable it requires nightly 

```bash
rustup default nightly
cargo update
cargo build --all-targets
```

This was tested on an Ubuntu 20.04 and was working
@gabrik . I tried this just now , but had the same error.  I also realized that I have Ubuntu 18.04 on this computer, sorry about saying I was using 20.04.

Which version of nightly are you using?

![image](https://user-images.githubusercontent.com/405933/135057552-b69dd2b5-7972-45c6-885e-301d3bad8fa2.png)


It seems it is getting the wrong version of the `shared_memory` crate, in some Linux installations.

I'll give a deeper look and come back with a solution/PR.






Fix patch:
diff --git a/Cargo.toml b/Cargo.toml
index b0120ff4..619d8727 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,19 +14,12 @@
 [workspace]
 
 members = [
-  "zrpc",
-  "zrpc-macros",
-  "znrpc-macros",
   "fog05-sdk",
   "fog05-fosctl",
   "fog05-agent",
   "fog05-rest",
 ]
 
-exclude = [
-  "zrpc-perf",
-
-]
 
 #[profile.release]
 #debug=false
diff --git a/fog05-agent/Cargo.toml b/fog05-agent/Cargo.toml
index b1a45ea5..e8740ab3 100644
--- a/fog05-agent/Cargo.toml
+++ b/fog05-agent/Cargo.toml
@@ -13,7 +13,10 @@ readme = "../README.md"
 
 [dependencies]
 async-std = { version = "=1.9.0", features = ["attributes"] }
-zenoh = { git = "https://github.com/eclipse-zenoh/zenoh.git", rev = "cf124d6c4d393e65662d1e1caf567b66af7150d5" }
+zenoh = { git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "master"}
+zrpc = { git = "https://github.com/atolab/zenoh-rpc.git", branch = "master" }
+znrpc-macros = { git = "https://github.com/atolab/zenoh-rpc.git", branch = "master" }
+fog05-sdk = {path = "../fog05-sdk"}
 async-trait = "0.1.36"
 futures = "0.3.5"
 thiserror = "1.0"
@@ -24,28 +27,24 @@ serde_json = "1.0.55"
 serde-aux = "2.1.1"
 bincode = "1.3.1"
 derive_more = "0.99.10"
-semver = { version = "0.11.0", features = ["serde"]}
+semver = { version = "1.0.4", features = ["serde"]}
 uuid = { version = "0.8.1", features = ["serde", "v4"] }
 base64 = "0.13.0"
 url = "2.1.1"
 mac_address = {version =  "1.1.1", features = ["serde"]}
-zrpc = {path = "../zrpc"}
-zrpc-macros = {path = "../zrpc-macros"}
-znrpc-macros = {path = "../znrpc-macros"}
-fog05-sdk = {path = "../fog05-sdk"}
-sysinfo = "0.16.1"
+sysinfo = "0.20"
 psutil = "3.2.0"
 async-ctrlc ={version = "1.2.0", features = ["stream"]}
 hostname = "0.3.1"
 reqwest = { version = "0.11.0", default-features = false, features = ["json", "rustls-tls" , "blocking"] }
-pnet = { version = "0.27.2", features = ["serde"]}
-pnet_datalink = { version = "0.27.2"}
-ipnetwork = "0.17.0"
+pnet = { version = "0.28", features = ["serde"]}
+pnet_datalink = { version = "0.28"}
+ipnetwork = "0.18"
 clap = "2.33"
 structopt = "0.3.13"
 rand = "0.8.3"
 log = "0.4"
-env_logger = "0.8.3"
+env_logger = "0.9"
 git-version = "0.3.4"
 
 # Debian package configuration
diff --git a/fog05-agent/src/agent.rs b/fog05-agent/src/agent.rs
index 5615a642..319c44d7 100644
--- a/fog05-agent/src/agent.rs
+++ b/fog05-agent/src/agent.rs
@@ -39,11 +39,12 @@ use znrpc_macros::znserver;
 use zrpc::ZNServe;
 
 use fog05_sdk::agent::{
-    AgentOrchestratorInterface, AgentOrchestratorInterfaceClient, AgentPluginInterface, OS,
+    orchestrator::AgentOrchestratorInterface, orchestrator::AgentOrchestratorInterfaceClient,
+    os::OS, plugin::AgentPluginInterface,
 };
 use fog05_sdk::fresult::{FError, FResult};
 use fog05_sdk::im;
-use fog05_sdk::plugins::{HypervisorPluginClient, NetworkingPluginClient};
+use fog05_sdk::plugins::{hypervisor::HypervisorPluginClient, networking::NetworkingPluginClient};
 use fog05_sdk::types;
 use fog05_sdk::types::{IPAddress, InterfaceKind};
 
@@ -156,14 +157,14 @@ impl Agent {
 
                 system.refresh_all();
                 let mem = im::node::RAMStatus {
-                    total: (system.get_total_memory() as f64) / 1024.0,
-                    free: (system.get_free_memory() as f64) / 1024.0,
+                    total: (system.total_memory() as f64) / 1024.0,
+                    free: (system.free_memory() as f64) / 1024.0,
                 };
-                for disk in system.get_disks() {
+                for disk in system.disks() {
                     let disk_status = im::node::DiskStatus {
-                        mount_point: String::from(disk.get_mount_point().to_str().unwrap()),
-                        total: (disk.get_total_space() as f64) / 1024.0 / 1024.0,
-                        free: (disk.get_available_space() as f64) / 1024.0 / 1024.0,
+                        mount_point: String::from(disk.mount_point().to_str().unwrap()),
+                        total: (disk.total_space() as f64) / 1024.0 / 1024.0,
+                        free: (disk.available_space() as f64) / 1024.0 / 1024.0,
                     };
                     disks.push(disk_status);
                 }
@@ -173,7 +174,7 @@ impl Agent {
                     //let ps_ifaces = psutil::network::net_if_stats().unwrap();
                     //let ps_iface = ps_ifaces.get(&iface.name).ok_or(FError::NotFound).unwrap();
                     let (_, sys_iface) = match system
-                        .get_networks()
+                        .networks()
                         .iter()
                         .find(|(name, _)| **name == iface.name)
                         .ok_or(FError::NotFound)
@@ -191,10 +192,10 @@ impl Agent {
                         is_up: true, //ps_iface.is_up(), //Filling because psutil-rust is not yet working
                         mtu: 1500,   //ps_iface.mtu(),
                         speed: 100,  //ps_iface.speed(),
-                        sent_pkts: sys_iface.get_total_packets_transmitted(),
-                        recv_pkts: sys_iface.get_total_packets_received(),
-                        sent_bytes: sys_iface.get_total_transmitted(),
-                        recv_bytes: sys_iface.get_total_received(),
+                        sent_pkts: sys_iface.total_packets_transmitted(),
+                        recv_pkts: sys_iface.total_packets_received(),
+                        sent_bytes: sys_iface.total_transmitted(),
+                        recv_bytes: sys_iface.total_received(),
                     };
 
                     ifaces.push(face);
@@ -301,13 +302,10 @@ impl Agent {
         //refresh information
         system.refresh_all();
 
-        for processor in system.get_processors() {
+        for processor in system.processors() {
             let cpu_spec = im::node::CPUSpec {
-                model: processor
-                    .get_vendor_id()
-                    .trim_end_matches('\u{0}')
-                    .to_string(),
-                frequency: processor.get_frequency(),
+                model: processor.vendor_id().trim_end_matches('\u{0}').to_string(),
+                frequency: processor.frequency(),
                 arch: arch.clone(),
             };
 
@@ -315,17 +313,17 @@ impl Agent {
         }
 
         let mem = im::node::RAMSpec {
-            size: (system.get_total_memory() as f64) / 1024.0,
+            size: (system.total_memory() as f64) / 1024.0,
         };
         let os = String::from(std::env::consts::OS);
         let name = String::from(hostname::get().unwrap().to_str().unwrap());
 
-        for disk in system.get_disks() {
+        for disk in system.disks() {
             let disk_spec = im::node::DiskSpec {
-                local_address: String::from(disk.get_name().to_os_string().to_str().unwrap()),
-                dimension: (disk.get_total_space() as f64) / 1024.0 / 1024.0,
-                mount_point: String::from(disk.get_mount_point().to_str().unwrap()),
-                file_system: String::from(std::str::from_utf8(disk.get_file_system()).unwrap()),
+                local_address: String::from(disk.name().to_os_string().to_str().unwrap()),
+                dimension: (disk.total_space() as f64) / 1024.0 / 1024.0,
+                mount_point: String::from(disk.mount_point().to_str().unwrap()),
+                file_system: String::from(std::str::from_utf8(disk.file_system()).unwrap()),
             };
 
             disks.push(disk_spec);
@@ -820,7 +818,7 @@ impl OS for Agent {
     async fn send_signal(&self, signal: u8, pid: u32) -> FResult<bool> {
         let mut system = sysinfo::System::new_all();
         system.refresh_all();
-        let process = system.get_process(pid.try_into()?);
+        let process = system.process(pid.try_into()?);
         match process {
             Some(p) => {
                 Err(FError::Unimplemented)
@@ -833,7 +831,7 @@ impl OS for Agent {
     async fn check_if_pid_exists(&self, pid: u32) -> FResult<bool> {
         let mut system = sysinfo::System::new_all();
         system.refresh_all();
-        let process = system.get_process(pid.try_into()?);
+        let process = system.process(pid.try_into()?);
         match process {
             Some(_) => Ok(true),
             None => Ok(false),
diff --git a/fog05-agent/src/main.rs b/fog05-agent/src/main.rs
index 7e293ea5..e8a752de 100644
--- a/fog05-agent/src/main.rs
+++ b/fog05-agent/src/main.rs
@@ -79,7 +79,7 @@ async fn main() {
     info!("Eclipse fog05 Agent {}", GIT_VERSION);
 
     let conf_file_path = Path::new(&args.config);
-    let config = serde_yaml::from_str::<AgentConfig>(&(read_file(&conf_file_path).await)).unwrap();
+    let config = serde_yaml::from_str::<AgentConfig>(&(read_file(conf_file_path).await)).unwrap();
 
     info!("Eclipse fog05 Agent -- bootstrap");
 
diff --git a/fog05-fosctl/Cargo.toml b/fog05-fosctl/Cargo.toml
index 1c9aa41b..e3195707 100644
--- a/fog05-fosctl/Cargo.toml
+++ b/fog05-fosctl/Cargo.toml
@@ -18,6 +18,9 @@ maintenance = { status = "actively-developed" }
 
 [dependencies]
 async-std = { version = "=1.9.0", features = ["attributes"] }
+zenoh = { git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "master"}
+fog05-sdk = {path = "../fog05-sdk" }
+
 structopt = "0.3.13"
 clap = "2.33"
 exitfailure = "0.5.1"
@@ -27,17 +30,17 @@ reqwest = { version = "0.11.0", default-features = false, features = ["json", "r
 uuid = { version = "0.8.1", features = ["serde", "v4"] }
 base64 = "0.13.0"
 derive_more = "0.99.10"
-semver = { version = "0.11.0", features = ["serde"]}
+semver = { version = "1.0.4", features = ["serde"]}
 rand = "0.8.3"
-fog05-sdk = {path = "../fog05-sdk" }
-zenoh = { git = "https://github.com/eclipse-zenoh/zenoh.git", rev = "cf124d6c4d393e65662d1e1caf567b66af7150d5" }
+
+
 serde_derive = "1.0.55"
 serde = { version = "1.0.55", features = ["derive"] }
 serde_yaml = "0.8.13"
 serde_json = "1.0.55"
 serde-aux = "2.1.1"
 log = "0.4"
-env_logger = "0.8.3"
+env_logger = "0.9"
 git-version = "0.3.4"
 
 
diff --git a/fog05-fosctl/src/fim.rs b/fog05-fosctl/src/fim.rs
index caae5a79..f1c826a9 100644
--- a/fog05-fosctl/src/fim.rs
+++ b/fog05-fosctl/src/fim.rs
@@ -26,7 +26,7 @@ use zenoh::*;
 
 use rand::seq::SliceRandom;
 
-use fog05_sdk::agent::AgentOrchestratorInterfaceClient;
+use fog05_sdk::agent::orchestrator::AgentOrchestratorInterfaceClient;
 use fog05_sdk::fresult::FError;
 use fog05_sdk::im::entity::EntityDescriptor;
 use fog05_sdk::im::fdu::FDUDescriptor;
diff --git a/fog05-rest/Cargo.toml b/fog05-rest/Cargo.toml
index 7d981c6b..60fb125f 100644
--- a/fog05-rest/Cargo.toml
+++ b/fog05-rest/Cargo.toml
@@ -7,24 +7,24 @@ edition = "2018"
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 
 [dependencies]
+async-std = { version = "=1.9.0", features = ["attributes"] }
+zenoh = { git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "master" }
+fog05-sdk = {path = "../fog05-sdk" }
 tide = "0.16.0"
 log = "0.4"
-env_logger = "0.8.3"
+env_logger = "0.9"
 git-version = "0.3.4"
 serde = { version = "1.0.55", features = ["derive"] }
 serde_derive = "1.0.55"
 serde_yaml = "0.8.13"
 serde_json = "1.0.55"
-async-std = { version = "=1.9.0", features = ["attributes"] }
-zenoh = { git = "https://github.com/eclipse-zenoh/zenoh.git", rev = "cf124d6c4d393e65662d1e1caf567b66af7150d5" }
+
 clap = "2.33"
 structopt = "0.3.13"
-fog05-sdk = {path = "../fog05-sdk" }
 rand = "0.8.3"
 uuid = { version = "0.8", features = ["serde", "v4"] }
 
 
-
 [package.metadata.deb]
 maintainer = "ADLINK fog05 team <fog05@adlink-labs.tech>"
 copyright = "2020, ADLINK Technology Inc"
diff --git a/fog05-rest/src/main.rs b/fog05-rest/src/main.rs
index 5580ef37..aff5e946 100644
--- a/fog05-rest/src/main.rs
+++ b/fog05-rest/src/main.rs
@@ -11,7 +11,7 @@ use structopt::StructOpt;
 
 use zenoh::*;
 
-use fog05_sdk::agent::AgentOrchestratorInterfaceClient;
+use fog05_sdk::agent::orchestrator::AgentOrchestratorInterfaceClient;
 // use fog05_sdk::fresult::FError;
 // use fog05_sdk::im::entity::{EntityDescriptor, EntityRecord};
 use fog05_sdk::im::fdu::{FDUDescriptor, FDURecord};
@@ -39,7 +39,6 @@ struct FOSRestConfig {
 #[derive(Clone)]
 struct FOSRestState {
     zsession: Arc<zenoh::net::Session>,
-    zenoh: Arc<zenoh::Zenoh>,
     zconnector: Arc<ZConnector>,
     config: FOSRestConfig,
 }
@@ -75,8 +74,7 @@ async fn main() -> tide::Result<()> {
     log::debug!("Eclipse fog05 REST Service {}", GIT_VERSION);
 
     let conf_file_path = Path::new(&args.config);
-    let config =
-        serde_yaml::from_str::<FOSRestConfig>(&(read_file(&conf_file_path).await)).unwrap();
+    let config = serde_yaml::from_str::<FOSRestConfig>(&(read_file(conf_file_path).await)).unwrap();
 
     log::debug!("Configuration {:?}", config);
 
@@ -90,11 +88,10 @@ async fn main() -> tide::Result<()> {
             .await
             .unwrap(),
     );
-    let zconnector = Arc::new(ZConnector::new(zenoh.clone(), None, None));
+    let zconnector = Arc::new(ZConnector::new(zenoh, None, None));
 
     let rest_state = FOSRestState {
         zsession,
-        zenoh,
         zconnector,
         config,
     };
diff --git a/fog05-sdk/Cargo.toml b/fog05-sdk/Cargo.toml
index 1259f086..0ef142a9 100644
--- a/fog05-sdk/Cargo.toml
+++ b/fog05-sdk/Cargo.toml
@@ -12,8 +12,13 @@ description = "fog05: The End-to-End Compute, Storage and Networking Virtualisat
 
 [dependencies]
 async-std = { version = "=1.9.0", features = ["attributes"] }
-zenoh = { git = "https://github.com/eclipse-zenoh/zenoh.git", rev = "cf124d6c4d393e65662d1e1caf567b66af7150d5" }
-uhlc = "0.2"
+zenoh = { git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "master"}
+zenoh-util = { git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "master" }
+zrpc = { git = "https://github.com/atolab/zenoh-rpc.git", branch = "master" }
+znrpc-macros = { git = "https://github.com/atolab/zenoh-rpc.git", branch = "master" }
+
+
+uhlc = "0.3.1"
 async-trait = "0.1.36"
 pin-project-lite = "0.2.4"
 futures = "0.3.5"
@@ -21,18 +26,16 @@ thiserror = "1.0"
 serde_derive = "1.0.55"
 serde = { version = "1.0.55", features = ["derive"] }
 derive_more = "0.99.10"
-semver = { version = "0.11.0", features = ["serde"]}
+semver = { version = "1.0.4", features = ["serde"]}
 uuid = { version = "0.8.1", features = ["serde", "v4"] }
 base64 = "0.13.0"
 url = "2.1.1"
 mac_address = {version =  "1.1.1", features = ["serde"]}
-zrpc = {path = "../zrpc"}
-znrpc-macros = {path = "../znrpc-macros"}
 log = "0.4"
-pnet = { version = "0.27.2", features = ["serde"]}
+pnet = { version = "0.28", features = ["serde"]}
 reqwest = { version = "0.11.0", default-features = false, features = ["json", "rustls-tls"] }
 rand = "0.8.3"
-ipnetwork = "0.17.0"
+ipnetwork = "0.18"
 machine-uid = "0.2.0"
 bincode = { version = "1.3.1", optional = true}
 serde_cbor = {version = "0.11.1", optional = true}
@@ -41,9 +44,9 @@ serde_json = { version = "1.0.55", optional = true}
 
 
 [dev-dependencies]
-env_logger = "0.8.3"
+env_logger = "0.9.0"
 mac_address = {version =  "1.1.1", features = ["serde"]}
-sysinfo = "0.16.1"
+sysinfo = "0.20.3"
 psutil = "3.2.0"
 machine-uid = "0.2.0"
 async-ctrlc ={version = "1.2.0", features = ["stream"]}
diff --git a/fog05-sdk/examples/agent-os.rs b/fog05-sdk/examples/agent-os.rs
index feeaf8a8..26dfa58d 100644
--- a/fog05-sdk/examples/agent-os.rs
+++ b/fog05-sdk/examples/agent-os.rs
@@ -1,6 +1,6 @@
 use async_std::sync::Arc;
 
-use fog05_sdk::agent::OSClient;
+use fog05_sdk::agent::os::OSClient;
 use zenoh::*;
 
 use url::Url;
diff --git a/fog05-sdk/examples/agent-plugin.rs b/fog05-sdk/examples/agent-plugin.rs
index d7eb5c7c..a7be3613 100644
--- a/fog05-sdk/examples/agent-plugin.rs
+++ b/fog05-sdk/examples/agent-plugin.rs
@@ -1,6 +1,6 @@
 use async_std::sync::Arc;
 
-use fog05_sdk::agent::AgentPluginInterfaceClient;
+use fog05_sdk::agent::plugin::AgentPluginInterfaceClient;
 use zenoh::*;
 
 #[async_std::main]
diff --git a/fog05-sdk/examples/dummy-hypervisor.rs b/fog05-sdk/examples/dummy-hypervisor.rs
index 25cfff0a..471288f7 100644
--- a/fog05-sdk/examples/dummy-hypervisor.rs
+++ b/fog05-sdk/examples/dummy-hypervisor.rs
@@ -18,11 +18,11 @@ use zenoh::*;
 use znrpc_macros::znserver;
 use zrpc::ZNServe;
 
-use fog05_sdk::agent::{AgentPluginInterfaceClient, OSClient};
+use fog05_sdk::agent::{os::OSClient, plugin::AgentPluginInterfaceClient};
 use fog05_sdk::fresult::{FError, FResult};
 use fog05_sdk::im::fdu::*;
 use fog05_sdk::im::fdu::{FDUDescriptor, FDURecord, FDUState};
-use fog05_sdk::plugins::{HypervisorPlugin, NetworkingPluginClient};
+use fog05_sdk::plugins::{hypervisor::HypervisorPlugin, networking::NetworkingPluginClient};
 use fog05_sdk::types::PluginKind;
 use fog05_sdk::zconnector::ZConnector;
 
diff --git a/fog05-sdk/examples/dummy-network.rs b/fog05-sdk/examples/dummy-network.rs
index 48425097..8ca84498 100644
--- a/fog05-sdk/examples/dummy-network.rs
+++ b/fog05-sdk/examples/dummy-network.rs
@@ -15,9 +15,9 @@ use zenoh::*;
 use znrpc_macros::znserver;
 use zrpc::ZNServe;
 
-use fog05_sdk::agent::{AgentPluginInterfaceClient, OSClient};
+use fog05_sdk::agent::{os::OSClient, plugin::AgentPluginInterfaceClient};
 use fog05_sdk::fresult::{FError, FResult};
-use fog05_sdk::plugins::NetworkingPlugin;
+use fog05_sdk::plugins::networking::NetworkingPlugin;
 use fog05_sdk::types::{
     BridgeKind, ConnectionPoint, GREKind, IPAddress, IPConfiguration, IPVersion, Interface,
     InterfaceKind, LinkKind, MACAddress, MACVLANKind, MCastVXLANInfo, NetworkNamespace, PluginKind,
diff --git a/fog05-sdk/src/agent.rs b/fog05-sdk/src/agent.rs
index 9fc06fee..3f67024d 100644
--- a/fog05-sdk/src/agent.rs
+++ b/fog05-sdk/src/agent.rs
@@ -18,11 +18,10 @@ use std::fmt;
 use thiserror::Error;
 use zenoh::*;
 
-use async_std::prelude::FutureExt;
 use async_std::sync::Arc;
 use async_std::task;
 use futures::prelude::*;
-use std::convert::TryFrom;
+
 use std::str;
 use std::str::FromStr;
 use std::time::Duration;
@@ -43,130 +42,161 @@ use crate::im;
 use crate::types;
 use crate::types::{IPAddress, InterfaceKind};
 
-#[znservice(
-    timeout_s = 60,
-    prefix = "/fos/local",
-    service_uuid = "00000000-0000-0000-0000-000000000001"
-)]
-pub trait OS {
-    // ex-OS plugin evals, used in agent<->plugin communication
-    // std::path::Path doesn't have a size known at compile-time, cannot be serialized, using String instead
-
-    async fn dir_exists(&self, dir_path: String) -> FResult<bool>;
-    async fn create_dir(&self, dir_path: String) -> FResult<bool>;
-    async fn rm_dir(&self, dir_path: String) -> FResult<bool>;
-
-    async fn download_file(&self, url: url::Url, dest_path: String) -> FResult<bool>;
-
-    async fn create_file(&self, file_path: String) -> FResult<bool>;
-    async fn rm_file(&self, file_path: String) -> FResult<bool>;
-    async fn store_file(&self, content: Vec<u8>, file_path: String) -> FResult<bool>;
-    async fn read_file(&self, file_path: String) -> FResult<Vec<u8>>;
-    async fn file_exists(&self, file_path: String) -> FResult<bool>;
-
-    async fn execute_command(&self, cmd: String) -> FResult<String>;
-    async fn send_signal(&self, signal: u8, pid: u32) -> FResult<bool>;
-    async fn check_if_pid_exists(&self, pid: u32) -> FResult<bool>;
-
-    async fn get_interface_type(&self, iface: String) -> FResult<InterfaceKind>;
-    async fn set_interface_unavailable(&self, iface: String) -> FResult<bool>;
-    async fn set_interface_available(&self, iface: String) -> FResult<bool>;
-    async fn get_local_mgmt_address(&self) -> FResult<IPAddress>;
-    async fn get_local_mgmt_interface(&self) -> FResult<String>;
+pub mod os {
+
+    use crate::fresult::FResult;
+    use crate::types::{IPAddress, InterfaceKind};
+    use uuid::Uuid;
+    use znrpc_macros::{znserver, znservice};
+    use zrpc::zrpcresult::{ZRPCError, ZRPCResult};
+
+    #[znservice(
+        timeout_s = 60,
+        prefix = "/fos/local",
+        service_uuid = "00000000-0000-0000-0000-000000000001"
+    )]
+    pub trait OS {
+        // ex-OS plugin evals, used in agent<->plugin communication
+        // std::path::Path doesn't have a size known at compile-time, cannot be serialized, using String instead
+
+        async fn dir_exists(&self, dir_path: String) -> FResult<bool>;
+        async fn create_dir(&self, dir_path: String) -> FResult<bool>;
+        async fn rm_dir(&self, dir_path: String) -> FResult<bool>;
+
+        async fn download_file(&self, url: url::Url, dest_path: String) -> FResult<bool>;
+
+        async fn create_file(&self, file_path: String) -> FResult<bool>;
+        async fn rm_file(&self, file_path: String) -> FResult<bool>;
+        async fn store_file(&self, content: Vec<u8>, file_path: String) -> FResult<bool>;
+        async fn read_file(&self, file_path: String) -> FResult<Vec<u8>>;
+        async fn file_exists(&self, file_path: String) -> FResult<bool>;
+
+        async fn execute_command(&self, cmd: String) -> FResult<String>;
+        async fn send_signal(&self, signal: u8, pid: u32) -> FResult<bool>;
+        async fn check_if_pid_exists(&self, pid: u32) -> FResult<bool>;
+
+        async fn get_interface_type(&self, iface: String) -> FResult<InterfaceKind>;
+        async fn set_interface_unavailable(&self, iface: String) -> FResult<bool>;
+        async fn set_interface_available(&self, iface: String) -> FResult<bool>;
+        async fn get_local_mgmt_address(&self) -> FResult<IPAddress>;
+        async fn get_local_mgmt_interface(&self) -> FResult<String>;
+    }
 }
 
-#[znservice(
-    timeout_s = 60,
-    prefix = "/fos/local",
-    service_uuid = "00000000-0000-0000-0000-000000000002"
-)]
-pub trait AgentPluginInterface {
-    async fn fdu_info(&self, fdu_uuid: Uuid) -> FResult<im::fdu::FDUDescriptor>;
-    async fn image_info(&self, image_uuid: Uuid) -> FResult<im::fdu::Image>;
-    async fn node_fdu_info(
-        &self,
-        fdu_uuid: Uuid,
-        node_uuid: Uuid,
-        instance_uuid: Uuid,
-    ) -> FResult<im::fdu::FDURecord>;
-    async fn network_info(&self, network_uuid: Uuid) -> FResult<types::VirtualNetwork>;
-    async fn connection_point_info(&self, cp_uuid: Uuid) -> FResult<types::ConnectionPoint>;
-    async fn node_management_address(&self, node_uuid: Uuid) -> FResult<IPAddress>;
-
-    async fn create_virtual_network(
-        &self,
-        vnet: types::VirtualNetworkConfig,
-    ) -> FResult<types::VirtualNetwork>;
-    async fn remove_virtual_network(&self, vnet_uuid: Uuid) -> FResult<Uuid>;
-
-    async fn create_connection_point(
-        &self,
-        cp: types::ConnectionPointConfig,
-    ) -> FResult<types::ConnectionPoint>;
-    async fn remove_connection_point(&self, cp_uuid: Uuid) -> FResult<Uuid>;
-
-    async fn bind_cp_to_fdu_face(
-        &self,
-        cp_uuid: Uuid,
-        instance_uuid: Uuid,
-        interface: String,
-    ) -> FResult<Uuid>;
-    async fn unbind_cp_from_fdu_face(
-        &self,
-        cp_uuid: Uuid,
-        instance_uuid: Uuid,
-        interface: String,
-    ) -> FResult<Uuid>;
-
-    async fn bind_cp_to_network(&self, cp_uuid: Uuid, vnet_uuid: Uuid) -> FResult<Uuid>;
-    async fn unbind_cp_from_network(&self, cp_uuid: Uuid, vnet_uuid: Uuid) -> FResult<Uuid>;
-
-    async fn get_node_uuid(&self) -> FResult<Uuid>;
-
-    async fn register_plugin(
-        &mut self,
-        plugin_uuid: Uuid,
-        kind: types::PluginKind,
-    ) -> FResult<Uuid>;
-    async fn unregister_plugin(&mut self, plugin_uuid: Uuid) -> FResult<Uuid>;
+pub mod plugin {
+
+    use crate::fresult::FResult;
+    use crate::im;
+    use crate::types;
+    use crate::types::{IPAddress, InterfaceKind};
+    use uuid::Uuid;
+    use znrpc_macros::{znserver, znservice};
+    use zrpc::zrpcresult::{ZRPCError, ZRPCResult};
+
+    #[znservice(
+        timeout_s = 60,
+        prefix = "/fos/local",
+        service_uuid = "00000000-0000-0000-0000-000000000002"
+    )]
+    pub trait AgentPluginInterface {
+        async fn fdu_info(&self, fdu_uuid: Uuid) -> FResult<im::fdu::FDUDescriptor>;
+        async fn image_info(&self, image_uuid: Uuid) -> FResult<im::fdu::Image>;
+        async fn node_fdu_info(
+            &self,
+            fdu_uuid: Uuid,
+            node_uuid: Uuid,
+            instance_uuid: Uuid,
+        ) -> FResult<im::fdu::FDURecord>;
+        async fn network_info(&self, network_uuid: Uuid) -> FResult<types::VirtualNetwork>;
+        async fn connection_point_info(&self, cp_uuid: Uuid) -> FResult<types::ConnectionPoint>;
+        async fn node_management_address(&self, node_uuid: Uuid) -> FResult<IPAddress>;
+
+        async fn create_virtual_network(
+            &self,
+            vnet: types::VirtualNetworkConfig,
+        ) -> FResult<types::VirtualNetwork>;
+        async fn remove_virtual_network(&self, vnet_uuid: Uuid) -> FResult<Uuid>;
+
+        async fn create_connection_point(
+            &self,
+            cp: types::ConnectionPointConfig,
+        ) -> FResult<types::ConnectionPoint>;
+        async fn remove_connection_point(&self, cp_uuid: Uuid) -> FResult<Uuid>;
+
+        async fn bind_cp_to_fdu_face(
+            &self,
+            cp_uuid: Uuid,
+            instance_uuid: Uuid,
+            interface: String,
+        ) -> FResult<Uuid>;
+        async fn unbind_cp_from_fdu_face(
+            &self,
+            cp_uuid: Uuid,
+            instance_uuid: Uuid,
+            interface: String,
+        ) -> FResult<Uuid>;
+
+        async fn bind_cp_to_network(&self, cp_uuid: Uuid, vnet_uuid: Uuid) -> FResult<Uuid>;
+        async fn unbind_cp_from_network(&self, cp_uuid: Uuid, vnet_uuid: Uuid) -> FResult<Uuid>;
+
+        async fn get_node_uuid(&self) -> FResult<Uuid>;
+
+        async fn register_plugin(
+            &mut self,
+            plugin_uuid: Uuid,
+            kind: types::PluginKind,
+        ) -> FResult<Uuid>;
+        async fn unregister_plugin(&mut self, plugin_uuid: Uuid) -> FResult<Uuid>;
+    }
 }
 
-#[znservice(
-    timeout_s = 60,
-    prefix = "/fos/local",
-    service_uuid = "00000000-0000-0000-0000-000000000003"
-)]
-pub trait AgentOrchestratorInterface {
-    async fn check_fdu_compatibility(&self, fdu_uuid: Uuid) -> FResult<bool>;
+pub mod orchestrator {
+
+    use crate::fresult::FResult;
+    use crate::im;
+    use crate::types;
+    use crate::types::{IPAddress, InterfaceKind};
+    use uuid::Uuid;
+    use znrpc_macros::{znserver, znservice};
+    use zrpc::zrpcresult::{ZRPCError, ZRPCResult};
+
+    #[znservice(
+        timeout_s = 60,
+        prefix = "/fos/local",
+        service_uuid = "00000000-0000-0000-0000-000000000003"
+    )]
+    pub trait AgentOrchestratorInterface {
+        async fn check_fdu_compatibility(&self, fdu_uuid: Uuid) -> FResult<bool>;
 
-    async fn schedule_fdu(&self, fdu_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
-    async fn schedule_entity(&self, entity: Uuid) -> FResult<Uuid>;
+        async fn schedule_fdu(&self, fdu_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
+        async fn schedule_entity(&self, entity: Uuid) -> FResult<Uuid>;
 
-    async fn deschedule_entity(&self, entity: Uuid) -> FResult<Uuid>;
+        async fn deschedule_entity(&self, entity: Uuid) -> FResult<Uuid>;
 
-    async fn onboard_fdu(&self, fdu: im::fdu::FDUDescriptor) -> FResult<Uuid>;
-    async fn onboard_entity(&self, entity: im::entity::EntityDescriptor) -> FResult<Uuid>;
+        async fn onboard_fdu(&self, fdu: im::fdu::FDUDescriptor) -> FResult<Uuid>;
+        async fn onboard_entity(&self, entity: im::entity::EntityDescriptor) -> FResult<Uuid>;
 
-    async fn define_fdu(&self, fdu_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
-    async fn configure_fdu(&self, instance_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
-    async fn start_fdu(&self, instance_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
+        async fn define_fdu(&self, fdu_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
+        async fn configure_fdu(&self, instance_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
+        async fn start_fdu(&self, instance_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
 
-    async fn run_fdu(&self, instance_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
-    async fn log_fdu(&self, instance_uuid: Uuid) -> FResult<String>;
-    async fn ls_fdu(&self, instance_uuid: Uuid) -> FResult<Vec<String>>;
-    async fn file_fdu(&self, instance_uuid: Uuid, file_name: String) -> FResult<String>;
+        async fn run_fdu(&self, instance_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
+        async fn log_fdu(&self, instance_uuid: Uuid) -> FResult<String>;
+        async fn ls_fdu(&self, instance_uuid: Uuid) -> FResult<Vec<String>>;
+        async fn file_fdu(&self, instance_uuid: Uuid, file_name: String) -> FResult<String>;
 
-    async fn stop_fdu(&self, instance_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
-    async fn clean_fdu(&self, instance_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
-    async fn undefine_fdu(&self, instance_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
+        async fn stop_fdu(&self, instance_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
+        async fn clean_fdu(&self, instance_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
+        async fn undefine_fdu(&self, instance_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
 
-    async fn offload_fdu(&self, fdu_uuid: Uuid) -> FResult<Uuid>;
-    async fn offload_entity(&self, entity_uuid: Uuid) -> FResult<Uuid>;
+        async fn offload_fdu(&self, fdu_uuid: Uuid) -> FResult<Uuid>;
+        async fn offload_entity(&self, entity_uuid: Uuid) -> FResult<Uuid>;
 
-    async fn fdu_status(&self, instance_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
+        async fn fdu_status(&self, instance_uuid: Uuid) -> FResult<im::fdu::FDURecord>;
 
-    async fn create_floating_ip(&self) -> FResult<Uuid>;
-    async fn delete_floating_ip(&self, ip_uuid: Uuid) -> FResult<Uuid>;
-    async fn assing_floating_ip(&self, ip_uuid: Uuid, cp_uuid: Uuid) -> FResult<Uuid>;
-    async fn retain_floating_ip(&self, ip_uuid: Uuid, cp_uuid: Uuid) -> FResult<Uuid>;
+        async fn create_floating_ip(&self) -> FResult<Uuid>;
+        async fn delete_floating_ip(&self, ip_uuid: Uuid) -> FResult<Uuid>;
+        async fn assing_floating_ip(&self, ip_uuid: Uuid, cp_uuid: Uuid) -> FResult<Uuid>;
+        async fn retain_floating_ip(&self, ip_uuid: Uuid, cp_uuid: Uuid) -> FResult<Uuid>;
+    }
 }
diff --git a/fog05-sdk/src/api.rs b/fog05-sdk/src/api.rs
index d4a6132a..076d588c 100644
--- a/fog05-sdk/src/api.rs
+++ b/fog05-sdk/src/api.rs
@@ -20,7 +20,7 @@ use async_std::sync::Arc;
 
 use zenoh::net::Session;
 
-use crate::agent::AgentOrchestratorInterfaceClient;
+use crate::agent::orchestrator::AgentOrchestratorInterfaceClient;
 use crate::fresult::FResult;
 use crate::im;
 use crate::zconnector::ZConnector;
diff --git a/fog05-sdk/src/plugins.rs b/fog05-sdk/src/plugins.rs
index 8e1daede..7ae23a3f 100644
--- a/fog05-sdk/src/plugins.rs
+++ b/fog05-sdk/src/plugins.rs
@@ -14,7 +14,6 @@
 #![allow(clippy::manual_async_fn)]
 #![allow(clippy::large_enum_variant)]
 
-use std::convert::TryFrom;
 use std::fmt;
 use std::str;
 use std::str::FromStr;
@@ -34,9 +33,8 @@ use log::trace;
 
 use ipnetwork::IpNetwork;
 
-use zrpc::zrpcresult::{ZRPCError, ZRPCResult};
-// use zrpc_macros::{zserver, zservice};
 use znrpc_macros::{znserver, znservice};
+use zrpc::zrpcresult::{ZRPCError, ZRPCResult};
 
 use crate::fresult::FResult;
 use crate::im::fdu::{FDUDescriptor, FDURecord};
@@ -45,255 +43,295 @@ use crate::types::{
     VirtualInterface, VirtualInterfaceConfig, VirtualNetwork, VirtualNetworkConfig,
 };
 
-#[znservice(
-    timeout_s = 60,
-    prefix = "/fos/local",
-    service_uuid = "00000000-0000-0000-0000-000000000004"
-)]
-pub trait NetworkingPlugin {
-    /// Creates the default fosbr0 virtual network
-    /// it's UUID is 00000000-0000-0000-0000-000000000000
-    /// it is a VXLAN kind of virtual network
-    /// VNI: 3845
-    /// MCast Addr: 239.15.5.0
-    /// Port 3845
-    /// Net: 10.240.0.0/16
-    /// Gateway: 10.240.0.1
-    /// Agents checks if there is already a default network in the system
-    /// if so it calls with the DHCP set to false
-    /// otherwise it is set to true an a DHCP for the default network
-    /// is started in the node
-    async fn create_default_virtual_network(&self, dhcp: bool) -> FResult<VirtualNetwork>;
-
-    /// Creates a virtual network with the given VirtualNetworkConfig in the node
-    /// if the network does not globally exists returns an error
-    /// if the network already exists iun the node does nothing
-    async fn create_virtual_network(&self, vnet_uuid: Uuid) -> FResult<VirtualNetwork>;
-
-    /// Gets the virtual network with the specified UUID
-    /// if the network is not present in the node returns
-    /// an error
-    async fn get_virtual_network(&self, vnet_uuid: Uuid) -> FResult<VirtualNetwork>;
-
-    /// Removes the virtual network from the node
-    /// if this was the last node in the network
-    /// the network is removed from the global catalog
-    async fn delete_virtual_network(&self, vnet_uuid: Uuid) -> FResult<VirtualNetwork>;
-
-    /// Creates a connection point in the node
-    async fn create_connection_point(&self) -> FResult<ConnectionPoint>;
-
-    /// Gets the connection point with the specified UUID
-    async fn get_connection_point(&self, cp_uuid: Uuid) -> FResult<ConnectionPoint>;
-
-    /// Removes the connection point from the node
-    async fn delete_connection_point(&self, cp_uuid: Uuid) -> FResult<Uuid>;
-
-    /// Creates a virtual interface in the nodes
-    /// following the given VirtualInterfaceConfig
-    /// if an interface with same UUID already exists
-    /// it does nothing
-    async fn create_virtual_interface(
-        &self,
-        intf: VirtualInterfaceConfig,
-    ) -> FResult<VirtualInterface>;
-
-    /// Gets the virtual interface matching the UUID
-    async fn get_virtual_interface(&self, intf_uuid: Uuid) -> FResult<VirtualInterface>;
-
-    /// Removes the virtual interface from the node
-    async fn delete_virtual_interface(&self, intf_uuid: Uuid) -> FResult<VirtualInterface>;
-
-    /// Creates a virtual bridge, this is a shortcut for
-    /// create_virtual_interface with Kind Bridge
-    /// if an interface with same name already exists
-    /// otherwise do nothing
-    async fn create_virtual_bridge(&self, br_name: String) -> FResult<VirtualInterface>;
-
-    /// Gets the virtual bridge matching the UUID
-    /// if the interface matching the UUID is not
-    /// a virtual bridge returns an error
-    async fn get_virtual_bridge(&self, br_uuid: Uuid) -> FResult<VirtualInterface>;
-
-    /// Removes the virtual bridge matching the UUID
-    /// if the interface matching the UUID is not
-    /// a virtual bridge returns an error
-    async fn delete_virtual_bridge(&self, br_uuid: Uuid) -> FResult<VirtualInterface>;
-
-    /// Sets the given interface as default route for in the given namespace
-    async fn set_default_route_in_network_namespace(
-        &self,
-        ns_uuid: Uuid,
-        intf_uuid: Uuid,
-    ) -> FResult<()>;
-
-    /// Creates a new network namespace in the node
-    async fn create_network_namespace(&self) -> FResult<NetworkNamespace>;
-
-    /// Gets the network namespace matching the given UUID
-    async fn get_network_namespace(&self, ns_uuid: Uuid) -> FResult<NetworkNamespace>;
-
-    /// Removes the network namespace matching the given UUID
-    async fn delete_network_namespace(&self, ns_uuid: Uuid) -> FResult<NetworkNamespace>;
-
-    /// Binds the interface to the given connection point
-    async fn bind_interface_to_connection_point(
-        &self,
-        intf_uuid: Uuid,
-        cp_uuid: Uuid,
-    ) -> FResult<VirtualInterface>;
-
-    /// Unbinds the interfaces from the given connection point
-    /// if they are not binded returns an error
-    async fn unbind_interface_from_connection_point(
-        &self,
-        intf_uuid: Uuid,
-        cp_uuid: Uuid,
-    ) -> FResult<VirtualInterface>;
-
-    /// Binds the connection point to the given virtual network
-    async fn bind_connection_point_to_virtual_network(
-        &self,
-        cp_uuid: Uuid,
-        vnet_uuid: Uuid,
-    ) -> FResult<ConnectionPoint>;
-
-    /// Unbinds the connection point from the virtual networks
-    /// if they are not connected returns an error
-    async fn unbind_connection_point_from_virtual_network(
-        &self,
-        cp_uuid: Uuid,
-        vnet_uuid: Uuid,
-    ) -> FResult<ConnectionPoint>;
-
-    /// Gets the addresses of the given interface
-    async fn get_interface_addresses(&self, intf_uuid: Uuid) -> FResult<Vec<IPAddress>>;
-
-    /// Gets the interface configured for Overlay networking
-    async fn get_overlay_iface(&self) -> FResult<String>;
-
-    /// Gets the interface configured for VLANs
-    async fn get_vlan_face(&self) -> FResult<String>;
-
-    /// Creates a MACVLAN interface, shortcut
-    /// to create_virtual_interface with MACVLAN kind
-    /// if an interface with same UUID already exists
-    /// and it is not MACVLAN returns an error
-    /// otherwise do nothing
-    async fn create_macvlan_interface(&self, master_intf: String) -> FResult<VirtualInterface>;
-
-    /// Removes the MACVLAN interface matching the UUID
-    /// if the interface matching is not a MACVLAN
-    /// returns an error
-    async fn delete_macvan_interface(&self, intf_uuid: Uuid) -> FResult<VirtualInterface>;
-
-    /// Moves the given interface into the given network namespace
-    async fn move_interface_info_namespace(
-        &self,
-        intf_uuid: Uuid,
-        ns_uuid: Uuid,
-    ) -> FResult<VirtualInterface>;
-
-    /// Moves the given interface into the default namespace
-    async fn move_interface_into_default_namespace(
-        &self,
-        intf_uuid: Uuid,
-    ) -> FResult<VirtualInterface>;
-
-    /// Renames the given interface
-    async fn rename_virtual_interface(
-        &self,
-        intf_uuid: Uuid,
-        intf_name: String,
-    ) -> FResult<VirtualInterface>;
-
-    /// Attaches the given interface to the given bridge
-    async fn attach_interface_to_bridge(
-        &self,
-        intf_uuid: Uuid,
-        br_uuid: Uuid,
-    ) -> FResult<VirtualInterface>;
-
-    /// Detaches the given interface from the given bridge
-    async fn detach_interface_from_bridge(&self, intf_uuid: Uuid) -> FResult<VirtualInterface>;
-
-    /// Creates a virtual interface in the given namespace
-    async fn create_virtual_interface_in_namespace(
-        &self,
-        intf: VirtualInterfaceConfig,
-        ns_uuid: Uuid,
-    ) -> FResult<VirtualInterface>;
-
-    /// Deletes the given virtual interface from the given namespace
-    async fn delete_virtual_interface_in_namespace(
-        &self,
-        intf_uuid: Uuid,
-        ns_uuid: Uuid,
-    ) -> FResult<VirtualInterface>;
-
-    /// Assigns the given address to the given interface
-    async fn assing_address_to_interface(
-        &self,
-        intf_uuid: Uuid,
-        address: Option<IpNetwork>,
-    ) -> FResult<VirtualInterface>;
-
-    /// Retains the given address from the given interface
-    async fn remove_address_from_interface(
-        &self,
-        intf_uuid: Uuid,
-        address: IPAddress,
-    ) -> FResult<VirtualInterface>;
-
-    /// Sets the MACAddress for the given interface
-    async fn set_macaddres_of_interface(
-        &self,
-        intf_uuid: Uuid,
-        address: MACAddress,
-    ) -> FResult<VirtualInterface>;
+pub mod networking {
+
+    use uuid::Uuid;
+    use zenoh::*;
+
+    use ipnetwork::IpNetwork;
+
+    use znrpc_macros::{znserver, znservice};
+    use zrpc::zrpcresult::{ZRPCError, ZRPCResult};
+
+    use crate::fresult::FResult;
+    use crate::im::fdu::{FDUDescriptor, FDURecord};
+    use crate::types::{
+        ConnectionPoint, ConnectionPointConfig, IPAddress, Interface, MACAddress, NetworkNamespace,
+        VirtualInterface, VirtualInterfaceConfig, VirtualNetwork, VirtualNetworkConfig,
+    };
+
+    #[znservice(
+        timeout_s = 60,
+        prefix = "/fos/local",
+        service_uuid = "00000000-0000-0000-0000-000000000004"
+    )]
+    pub trait NetworkingPlugin {
+        /// Creates the default fosbr0 virtual network
+        /// it's UUID is 00000000-0000-0000-0000-000000000000
+        /// it is a VXLAN kind of virtual network
+        /// VNI: 3845
+        /// MCast Addr: 239.15.5.0
+        /// Port 3845
+        /// Net: 10.240.0.0/16
+        /// Gateway: 10.240.0.1
+        /// Agents checks if there is already a default network in the system
+        /// if so it calls with the DHCP set to false
+        /// otherwise it is set to true an a DHCP for the default network
+        /// is started in the node
+        async fn create_default_virtual_network(&self, dhcp: bool) -> FResult<VirtualNetwork>;
+
+        /// Creates a virtual network with the given VirtualNetworkConfig in the node
+        /// if the network does not globally exists returns an error
+        /// if the network already exists iun the node does nothing
+        async fn create_virtual_network(&self, vnet_uuid: Uuid) -> FResult<VirtualNetwork>;
+
+        /// Gets the virtual network with the specified UUID
+        /// if the network is not present in the node returns
+        /// an error
+        async fn get_virtual_network(&self, vnet_uuid: Uuid) -> FResult<VirtualNetwork>;
+
+        /// Removes the virtual network from the node
+        /// if this was the last node in the network
+        /// the network is removed from the global catalog
+        async fn delete_virtual_network(&self, vnet_uuid: Uuid) -> FResult<VirtualNetwork>;
+
+        /// Creates a connection point in the node
+        async fn create_connection_point(&self) -> FResult<ConnectionPoint>;
+
+        /// Gets the connection point with the specified UUID
+        async fn get_connection_point(&self, cp_uuid: Uuid) -> FResult<ConnectionPoint>;
+
+        /// Removes the connection point from the node
+        async fn delete_connection_point(&self, cp_uuid: Uuid) -> FResult<Uuid>;
+
+        /// Creates a virtual interface in the nodes
+        /// following the given VirtualInterfaceConfig
+        /// if an interface with same UUID already exists
+        /// it does nothing
+        async fn create_virtual_interface(
+            &self,
+            intf: VirtualInterfaceConfig,
+        ) -> FResult<VirtualInterface>;
+
+        /// Gets the virtual interface matching the UUID
+        async fn get_virtual_interface(&self, intf_uuid: Uuid) -> FResult<VirtualInterface>;
+
+        /// Removes the virtual interface from the node
+        async fn delete_virtual_interface(&self, intf_uuid: Uuid) -> FResult<VirtualInterface>;
+
+        /// Creates a virtual bridge, this is a shortcut for
+        /// create_virtual_interface with Kind Bridge
+        /// if an interface with same name already exists
+        /// otherwise do nothing
+        async fn create_virtual_bridge(&self, br_name: String) -> FResult<VirtualInterface>;
+
+        /// Gets the virtual bridge matching the UUID
+        /// if the interface matching the UUID is not
+        /// a virtual bridge returns an error
+        async fn get_virtual_bridge(&self, br_uuid: Uuid) -> FResult<VirtualInterface>;
+
+        /// Removes the virtual bridge matching the UUID
+        /// if the interface matching the UUID is not
+        /// a virtual bridge returns an error
+        async fn delete_virtual_bridge(&self, br_uuid: Uuid) -> FResult<VirtualInterface>;
+
+        /// Sets the given interface as default route for in the given namespace
+        async fn set_default_route_in_network_namespace(
+            &self,
+            ns_uuid: Uuid,
+            intf_uuid: Uuid,
+        ) -> FResult<()>;
+
+        /// Creates a new network namespace in the node
+        async fn create_network_namespace(&self) -> FResult<NetworkNamespace>;
+
+        /// Gets the network namespace matching the given UUID
+        async fn get_network_namespace(&self, ns_uuid: Uuid) -> FResult<NetworkNamespace>;
+
+        /// Removes the network namespace matching the given UUID
+        async fn delete_network_namespace(&self, ns_uuid: Uuid) -> FResult<NetworkNamespace>;
+
+        /// Binds the interface to the given connection point
+        async fn bind_interface_to_connection_point(
+            &self,
+            intf_uuid: Uuid,
+            cp_uuid: Uuid,
+        ) -> FResult<VirtualInterface>;
+
+        /// Unbinds the interfaces from the given connection point
+        /// if they are not binded returns an error
+        async fn unbind_interface_from_connection_point(
+            &self,
+            intf_uuid: Uuid,
+            cp_uuid: Uuid,
+        ) -> FResult<VirtualInterface>;
+
+        /// Binds the connection point to the given virtual network
+        async fn bind_connection_point_to_virtual_network(
+            &self,
+            cp_uuid: Uuid,
+            vnet_uuid: Uuid,
+        ) -> FResult<ConnectionPoint>;
+
+        /// Unbinds the connection point from the virtual networks
+        /// if they are not connected returns an error
+        async fn unbind_connection_point_from_virtual_network(
+            &self,
+            cp_uuid: Uuid,
+            vnet_uuid: Uuid,
+        ) -> FResult<ConnectionPoint>;
+
+        /// Gets the addresses of the given interface
+        async fn get_interface_addresses(&self, intf_uuid: Uuid) -> FResult<Vec<IPAddress>>;
+
+        /// Gets the interface configured for Overlay networking
+        async fn get_overlay_iface(&self) -> FResult<String>;
+
+        /// Gets the interface configured for VLANs
+        async fn get_vlan_face(&self) -> FResult<String>;
+
+        /// Creates a MACVLAN interface, shortcut
+        /// to create_virtual_interface with MACVLAN kind
+        /// if an interface with same UUID already exists
+        /// and it is not MACVLAN returns an error
+        /// otherwise do nothing
+        async fn create_macvlan_interface(&self, master_intf: String) -> FResult<VirtualInterface>;
+
+        /// Removes the MACVLAN interface matching the UUID
+        /// if the interface matching is not a MACVLAN
+        /// returns an error
+        async fn delete_macvan_interface(&self, intf_uuid: Uuid) -> FResult<VirtualInterface>;
+
+        /// Moves the given interface into the given network namespace
+        async fn move_interface_info_namespace(
+            &self,
+            intf_uuid: Uuid,
+            ns_uuid: Uuid,
+        ) -> FResult<VirtualInterface>;
+
+        /// Moves the given interface into the default namespace
+        async fn move_interface_into_default_namespace(
+            &self,
+            intf_uuid: Uuid,
+        ) -> FResult<VirtualInterface>;
+
+        /// Renames the given interface
+        async fn rename_virtual_interface(
+            &self,
+            intf_uuid: Uuid,
+            intf_name: String,
+        ) -> FResult<VirtualInterface>;
+
+        /// Attaches the given interface to the given bridge
+        async fn attach_interface_to_bridge(
+            &self,
+            intf_uuid: Uuid,
+            br_uuid: Uuid,
+        ) -> FResult<VirtualInterface>;
+
+        /// Detaches the given interface from the given bridge
+        async fn detach_interface_from_bridge(&self, intf_uuid: Uuid) -> FResult<VirtualInterface>;
+
+        /// Creates a virtual interface in the given namespace
+        async fn create_virtual_interface_in_namespace(
+            &self,
+            intf: VirtualInterfaceConfig,
+            ns_uuid: Uuid,
+        ) -> FResult<VirtualInterface>;
+
+        /// Deletes the given virtual interface from the given namespace
+        async fn delete_virtual_interface_in_namespace(
+            &self,
+            intf_uuid: Uuid,
+            ns_uuid: Uuid,
+        ) -> FResult<VirtualInterface>;
+
+        /// Assigns the given address to the given interface
+        async fn assing_address_to_interface(
+            &self,
+            intf_uuid: Uuid,
+            address: Option<IpNetwork>,
+        ) -> FResult<VirtualInterface>;
+
+        /// Retains the given address from the given interface
+        async fn remove_address_from_interface(
+            &self,
+            intf_uuid: Uuid,
+            address: IPAddress,
+        ) -> FResult<VirtualInterface>;
+
+        /// Sets the MACAddress for the given interface
+        async fn set_macaddres_of_interface(
+            &self,
+            intf_uuid: Uuid,
+            address: MACAddress,
+        ) -> FResult<VirtualInterface>;
+    }
 }
 
-#[znservice(
-    timeout_s = 60,
-    prefix = "/fos/local",
-    service_uuid = "00000000-0000-0000-0000-000000000005"
-)]
-pub trait HypervisorPlugin {
-    /// Defines the given FDU in the node
-    async fn define_fdu(&mut self, fdu: FDUDescriptor) -> FResult<FDURecord>;
+pub mod hypervisor {
+
+    use uuid::Uuid;
+    use zenoh::*;
+
+    use ipnetwork::IpNetwork;
+
+    use znrpc_macros::{znserver, znservice};
+    use zrpc::zrpcresult::{ZRPCError, ZRPCResult};
+
+    use crate::fresult::FResult;
+    use crate::im::fdu::{FDUDescriptor, FDURecord};
+    use crate::types::{
+        ConnectionPoint, ConnectionPointConfig, IPAddress, Interface, MACAddress, NetworkNamespace,
+        VirtualInterface, VirtualInterfaceConfig, VirtualNetwork, VirtualNetworkConfig,
+    };
+
+    #[znservice(
+        timeout_s = 60,
+        prefix = "/fos/local",
+        service_uuid = "00000000-0000-0000-0000-000000000005"
+    )]
+    pub trait HypervisorPlugin {
+        /// Defines the given FDU in the node
+        async fn define_fdu(&mut self, fdu: FDUDescriptor) -> FResult<FDURecord>;
 
-    /// Undefines the given instance
-    async fn undefine_fdu(&mut self, instance_uuid: Uuid) -> FResult<Uuid>;
+        /// Undefines the given instance
+        async fn undefine_fdu(&mut self, instance_uuid: Uuid) -> FResult<Uuid>;
 
-    /// Configures the given instance
-    async fn configure_fdu(&mut self, instance_uuid: Uuid) -> FResult<Uuid>;
+        /// Configures the given instance
+        async fn configure_fdu(&mut self, instance_uuid: Uuid) -> FResult<Uuid>;
 
-    /// Cleans the given instance
-    async fn clean_fdu(&mut self, instance_uuid: Uuid) -> FResult<Uuid>;
+        /// Cleans the given instance
+        async fn clean_fdu(&mut self, instance_uuid: Uuid) -> FResult<Uuid>;
 
-    /// Starts the given instance
-    async fn start_fdu(&mut self, instance_uuid: Uuid) -> FResult<Uuid>;
+        /// Starts the given instance
+        async fn start_fdu(&mut self, instance_uuid: Uuid) -> FResult<Uuid>;
 
-    /// Runs the given instance in a BLOCKING mode
-    async fn run_fdu(&mut self, instance_uuid: Uuid) -> FResult<Uuid>; //this should be somehow blocking...
+        /// Runs the given instance in a BLOCKING mode
+        async fn run_fdu(&mut self, instance_uuid: Uuid) -> FResult<Uuid>; //this should be somehow blocking...
 
-    /// Gets log of the given instance, what log means depend on the FDU
-    /// may be left unimplemented
-    async fn log_fdu(&mut self, instance_uuid: Uuid) -> FResult<String>;
+        /// Gets log of the given instance, what log means depend on the FDU
+        /// may be left unimplemented
+        async fn log_fdu(&mut self, instance_uuid: Uuid) -> FResult<String>;
 
-    /// Lists files in the instance, may be left unimplemented, depends on the FDU
-    async fn ls_fdu(&mut self, instance_uuid: Uuid) -> FResult<Vec<String>>;
+        /// Lists files in the instance, may be left unimplemented, depends on the FDU
+        async fn ls_fdu(&mut self, instance_uuid: Uuid) -> FResult<Vec<String>>;
 
-    /// Gets the specified file from the instance, may be left unimplemented
-    /// depends on th FDU
-    async fn file_fdu(&mut self, instance_uuid: Uuid, file_name: String) -> FResult<String>;
+        /// Gets the specified file from the instance, may be left unimplemented
+        /// depends on th FDU
+        async fn file_fdu(&mut self, instance_uuid: Uuid, file_name: String) -> FResult<String>;
 
-    /// Stops the given instance
-    async fn stop_fdu(&mut self, instance_uuid: Uuid) -> FResult<Uuid>;
+        /// Stops the given instance
+        async fn stop_fdu(&mut self, instance_uuid: Uuid) -> FResult<Uuid>;
 
-    /// Migrates the instance to destination node
-    async fn migrate_fdu(&mut self, instance_uuid: Uuid, destination_uuid: Uuid) -> FResult<Uuid>;
+        /// Migrates the instance to destination node
+        async fn migrate_fdu(
+            &mut self,
+            instance_uuid: Uuid,
+            destination_uuid: Uuid,
+        ) -> FResult<Uuid>;
 
-    /// Gets the status of the instance from the hypervisor
-    async fn get_fdu_status(&self, instance_uuid: Uuid) -> FResult<FDURecord>;
+        /// Gets the status of the instance from the hypervisor
+        async fn get_fdu_status(&self, instance_uuid: Uuid) -> FResult<FDURecord>;
+    }
 }
diff --git a/fog05-sdk/src/zconnector/mod.rs b/fog05-sdk/src/zconnector/mod.rs
index 67cdbdb2..d2d868e4 100644
--- a/fog05-sdk/src/zconnector/mod.rs
+++ b/fog05-sdk/src/zconnector/mod.rs
@@ -385,7 +385,7 @@ macro_rules! NETNS_SELECTOR {
 pin_project! {
     pub struct FDURecordStream<'a> {
         #[pin]
-        change_stream: zenoh::ChangeStream<'a>,
+        change_stream: zenoh::ChangeReceiver<'a>,
     }
 }
 
diff --git a/fog05-sdk/src/zconnector/serializers.rs b/fog05-sdk/src/zconnector/serializers.rs
index 704de1fc..f82ca566 100644
--- a/fog05-sdk/src/zconnector/serializers.rs
+++ b/fog05-sdk/src/zconnector/serializers.rs
@@ -54,10 +54,10 @@ where
     T: DeserializeOwned,
 {
     #[cfg(feature = "data_bincode")]
-    return Ok(bincode::deserialize::<T>(&raw_data)?);
+    return Ok(bincode::deserialize::<T>(raw_data)?);
 
     #[cfg(feature = "data_cbor")]
-    return Ok(serde_cbor::from_slice::<T>(&raw_data)?);
+    return Ok(serde_cbor::from_slice::<T>(raw_data)?);
 
     #[cfg(feature = "data_json")]
     return Ok(serde_json::from_str::<T>(std::str::from_utf8(raw_data)?)?);
diff --git a/rust-toolchain b/rust-toolchain
new file mode 100644
index 00000000..bf867e0a
--- /dev/null
+++ b/rust-toolchain
@@ -0,0 +1,1 @@
+nightly
diff --git a/znrpc-macros/Cargo.toml b/znrpc-macros/Cargo.toml
deleted file mode 100644
index 6c22b398..00000000
--- a/znrpc-macros/Cargo.toml
+++ /dev/null
@@ -1,48 +0,0 @@
-[package]
-name = "znrpc-macros"
-version = "0.3.0-alpha1"
-repository = "https://github.com/eclipse-fog05/fog05"
-homepage = "http://fog05.io"
-authors = ["gabrik <gabriele.baldoni@gmail.com>"]
-edition = "2018"
-license = " EPL-2.0 OR Apache-2.0"
-description = "fog05: The End-to-End Compute, Storage and Networking Virtualisation solution."
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-# To build with debug on macros: RUSTFLAGS="-Z macro-backtrace"
-
-[dependencies]
-async-std = { version = "=1.9.0", features = ["attributes"] }
-futures = "0.3.5"
-syn-serde = { version = "0.2", features = ["json"] }
-syn = { version = "1.0.11", features = ["full"] }
-quote = "1.0.2"
-proc-macro2 = "1.0.6"
-serde_derive = "1.0.55"
-serde = { version = "1.0.55", features = ["derive"] }
-zenoh = { git = "https://github.com/eclipse-zenoh/zenoh.git", rev = "cf124d6c4d393e65662d1e1caf567b66af7150d5" }
-uhlc = "0.2"
-zrpc = {path = "../zrpc"}
-base64 = "0.13.0"
-log = "0.4.11"
-uuid = { version = "0.8.1", features = ["serde", "v4"] }
-darling = "0.12.0"
-Inflector = "0.11.4"
-
-
-
-
-[dev-dependencies]
-env_logger = "0.8.3"
-
-
-[lib]
-proc-macro = true
-
-
-[[example]]
-name = "znservice"
-
-
-[[example]]
-name = "expanded"
diff --git a/znrpc-macros/examples/expanded.rs b/znrpc-macros/examples/expanded.rs
deleted file mode 100644
index 6661455d..00000000
--- a/znrpc-macros/examples/expanded.rs
+++ /dev/null
@@ -1,741 +0,0 @@
-#![feature(prelude_import)]
-#![allow(clippy::manual_async_fn)]
-#![allow(clippy::large_enum_variant)]
-#[prelude_import]
-extern crate serde;
-extern crate std;
-
-use std::prelude::v1::*;
-
-use async_std::prelude::FutureExt;
-use async_std::sync::{Arc, Mutex};
-use async_std::task;
-use futures::prelude::*;
-use std::convert::TryFrom;
-use std::str;
-use std::time::Duration;
-use uuid::Uuid;
-use zenoh::*;
-
-use serde::{Deserialize, Serialize};
-use zrpc::zrpcresult::{ZRPCError, ZRPCResult};
-use zrpc::ZNServe;
-
-pub trait Hello: Clone {
-    fn hello(
-        &self,
-        name: String,
-    ) -> ::core::pin::Pin<Box<dyn ::core::future::Future<Output = String> + core::marker::Send + '_>>;
-    fn add(
-        &mut self,
-    ) -> ::core::pin::Pin<Box<dyn ::core::future::Future<Output = u64> + core::marker::Send + '_>>;
-    /// Returns the server object
-    fn get_hello_server(
-        self,
-        z: async_std::sync::Arc<zenoh::net::Session>,
-        id: Option<uuid::Uuid>,
-    ) -> ServeHello<Self> {
-        let id = id.unwrap_or(Uuid::new_v4());
-        ServeHello::new(z, self, id)
-    }
-}
-
-#[derive(Clone, Debug)]
-pub struct ServeHello<S> {
-    z: async_std::sync::Arc<zenoh::net::Session>,
-    server: S,
-    instance_id: uuid::Uuid,
-    state: async_std::sync::Arc<async_std::sync::RwLock<zrpc::ComponentState>>,
-}
-
-impl<S> ServeHello<S> {
-    pub fn new(z: async_std::sync::Arc<zenoh::net::Session>, server: S, id: uuid::Uuid) -> Self {
-        let ci = zrpc::ComponentState {
-            uuid: id,
-            name: "HelloService".to_string(),
-            routerid: "".to_string(),
-            peerid: "".to_string(),
-            status: zrpc::ComponentStatus::HALTED,
-        };
-        Self {
-            z,
-            server,
-            instance_id: id,
-            state: async_std::sync::Arc::new(async_std::sync::RwLock::new(ci)),
-        }
-    }
-}
-impl<S> zrpc::ZNServe<HelloRequest> for ServeHello<S>
-where
-    S: Hello + Send + 'static,
-{
-    type Resp = HelloResponse;
-    fn instance_uuid(&self) -> uuid::Uuid {
-        self.instance_id
-    }
-
-    #[allow(unused)]
-    #[allow(clippy::type_complexity, clippy::manual_async_fn)]
-    fn connect(
-        &'_ self,
-    ) -> ::core::pin::Pin<
-        Box<
-            dyn std::future::Future<
-                    Output = ZRPCResult<(
-                        async_std::channel::Sender<()>,
-                        async_std::task::JoinHandle<ZRPCResult<()>>,
-                    )>,
-                > + '_,
-        >,
-    > {
-        async fn __connect<S>(
-            _self: &ServeHello<S>,
-        ) -> ZRPCResult<(
-            async_std::channel::Sender<()>,
-            async_std::task::JoinHandle<ZRPCResult<()>>,
-        )>
-        where
-            S: Hello + Send + 'static,
-        {
-            let zinfo = _self.z.info().await;
-            let pid = zinfo
-                .get(&zenoh::net::info::ZN_INFO_PID_KEY)
-                .ok_or(ZRPCError::MissingValue)?
-                .to_uppercase();
-            let rid = match zinfo.get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY) {
-                Some(r_info) => {
-                    if r_info != "" {
-                        r_info.split(",").collect::<Vec<_>>()[0].to_uppercase()
-                    } else {
-                        "".to_string()
-                    }
-                }
-                None => "".to_string(),
-            };
-            let mut ci = _self.state.write().await;
-            ci.peerid = pid.clone().to_uppercase();
-            drop(ci);
-            let (s, r) = async_std::channel::bounded::<()>(1);
-            let zsession = _self.z.clone();
-            let state = _self.state.clone();
-            let path = zenoh::Path::try_from(format!(
-                "/znservice/Hello/2967c40b-a9a4-4330-b5f6-e0315b2356a9/{}/state",
-                _self.instance_uuid()
-            ))?;
-
-            let h = async_std::task::spawn(async move {
-                let mut queryable = zsession
-                    .declare_queryable(&path.clone().into(), zenoh::net::queryable::EVAL)
-                    .await?;
-
-                let rcv_loop = async {
-                    loop {
-                        let query = queryable
-                            .stream()
-                            .next()
-                            .await
-                            .ok_or_else(|| async_std::channel::RecvError)?;
-                        let ci = state.read().await;
-                        let data = zrpc::serialize::serialize_state(&*ci)
-                            .map_err(|_| async_std::channel::RecvError)?;
-                        drop(ci);
-                        let sample = zenoh::net::Sample {
-                            res_name: path.to_string().clone(),
-                            payload: data.into(),
-                            data_info: Some(zenoh::net::protocol::proto::DataInfo {
-                                source_id: None,
-                                source_sn: None,
-                                first_router_id: None,
-                                first_router_sn: None,
-                                timestamp: Some(uhlc::Timestamp::new(
-                                    Default::default(),
-                                    uhlc::ID::new(16, [1u8; uhlc::ID::MAX_SIZE]),
-                                )),
-                                kind: None,
-                                encoding: None,
-                            }),
-                        };
-
-                        query.reply(sample).await;
-                    }
-                };
-
-                rcv_loop
-                    .race(r.recv())
-                    .await
-                    .map_err(|e| ZRPCError::Error(format!("{}", e)))
-            });
-            Ok((s, h))
-        }
-        Box::pin(__connect(self))
-    }
-    #[allow(clippy::type_complexity, clippy::manual_async_fn)]
-    fn initialize(
-        &self,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-        async fn __initialize<S>(_self: &ServeHello<S>) -> ZRPCResult<()>
-        where
-            S: Hello + Send + 'static,
-        {
-            let mut ci = _self.state.write().await;
-            match ci.status {
-                zrpc::ComponentStatus::HALTED => {
-                    ci.status = zrpc::ComponentStatus::INITIALIZING;
-                    Ok(())
-                }
-                _ => Err(ZRPCError::StateTransitionNotAllowed(
-                    "Cannot initialize a component in a state different than HALTED".to_string(),
-                )),
-            }
-        }
-        Box::pin(__initialize(self))
-    }
-    #[allow(clippy::type_complexity, clippy::manual_async_fn)]
-    fn register(
-        &self,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-        async fn __register<S>(_self: &ServeHello<S>) -> ZRPCResult<()>
-        where
-            S: Hello + Send + 'static,
-        {
-            let mut ci = _self.state.write().await;
-            match ci.status {
-                zrpc::ComponentStatus::INITIALIZING => {
-                    ci.status = zrpc::ComponentStatus::REGISTERED;
-                    Ok(())
-                }
-                _ => Err(ZRPCError::StateTransitionNotAllowed(
-                    "Cannot register a component in a state different than INITIALIZING"
-                        .to_string(),
-                )),
-            }
-        }
-        Box::pin(__register(self))
-    }
-    #[allow(
-        clippy::type_complexity,
-        clippy::manual_async_fn,
-        clippy::needless_question_mark
-    )]
-    fn start(
-        &self,
-    ) -> ::core::pin::Pin<
-        Box<
-            dyn std::future::Future<
-                    Output = ZRPCResult<(
-                        async_std::channel::Sender<()>,
-                        async_std::task::JoinHandle<ZRPCResult<()>>,
-                    )>,
-                > + '_,
-        >,
-    > {
-        async fn __start<S>(
-            _self: &ServeHello<S>,
-        ) -> ZRPCResult<(
-            async_std::channel::Sender<()>,
-            async_std::task::JoinHandle<ZRPCResult<()>>,
-        )>
-        where
-            S: Hello + Send + 'static,
-        {
-            let (s, r) = async_std::channel::bounded::<()>(1);
-            let barrier = async_std::sync::Arc::new(async_std::sync::Barrier::new(2));
-            let ci = _self.state.read().await;
-            match ci.status {
-                zrpc::ComponentStatus::REGISTERED => {
-                    drop(ci);
-
-                    let server = _self.clone();
-                    let b = barrier.clone();
-                    let h = async_std::task::spawn_blocking(move || {
-                        async_std::task::block_on(async { server.serve(r, b).await })
-                    });
-
-                    barrier.wait().await;
-
-                    let mut ci = _self.state.write().await;
-                    ci.status = zrpc::ComponentStatus::SERVING;
-                    drop(ci);
-
-                    Ok((s, h))
-                }
-                _ => Err(ZRPCError::StateTransitionNotAllowed(
-                    "Cannot start a component in a state different than REGISTERED".to_string(),
-                )),
-            }
-        }
-        Box::pin(__start(self))
-    }
-    #[allow(clippy::type_complexity, clippy::manual_async_fn)]
-    fn serve(
-        &self,
-        stop: async_std::channel::Receiver<()>,
-        barrier: async_std::sync::Arc<async_std::sync::Barrier>,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-        async fn __serve<S>(
-            _self: &ServeHello<S>,
-            _stop: async_std::channel::Receiver<()>,
-            _barrier: async_std::sync::Arc<async_std::sync::Barrier>,
-        ) -> ZRPCResult<()>
-        where
-            S: Hello + Send + 'static,
-        {
-            let ci = _self.state.read().await;
-            match ci.status {
-                zrpc::ComponentStatus::REGISTERED => {
-                    drop(ci);
-                    let path = zenoh::Path::try_from(format!(
-                        "/znservice/Hello/2967c40b-a9a4-4330-b5f6-e0315b2356a9/{}/eval",
-                        _self.instance_uuid()
-                    ))?;
-
-                    let mut queryable = _self
-                        .z
-                        .declare_queryable(&path.clone().into(), zenoh::net::queryable::EVAL)
-                        .await?;
-                    _barrier.wait().await;
-                    let rcv_loop = async {
-                        loop {
-                            let query = queryable
-                                .stream()
-                                .next()
-                                .await
-                                .ok_or_else(|| async_std::channel::RecvError)?;
-
-                            let base64_req = query.predicate.clone();
-                            let b64_bytes = base64::decode(base64_req)
-                                .map_err(|_| async_std::channel::RecvError)?;
-                            let req =
-                                zrpc::serialize::deserialize_request::<HelloRequest>(&b64_bytes)
-                                    .map_err(|_| async_std::channel::RecvError)?;
-
-                            let mut ser = _self.server.clone();
-                            let p = path.clone();
-                            match req {
-                                HelloRequest::Hello { name } => {
-                                    let resp = HelloResponse::Hello(ser.hello(name).await);
-                                    let encoded = zrpc::serialize::serialize_response(&resp)
-                                        .map_err(|_| async_std::channel::RecvError)?;
-                                    let sample = zenoh::net::Sample {
-                                        res_name: p.to_string().clone(),
-                                        payload: encoded.into(),
-                                        data_info: Some(zenoh::net::protocol::proto::DataInfo {
-                                            source_id: None,
-                                            source_sn: None,
-                                            first_router_id: None,
-                                            first_router_sn: None,
-                                            timestamp: Some(uhlc::Timestamp::new(
-                                                Default::default(),
-                                                uhlc::ID::new(16, [1u8; uhlc::ID::MAX_SIZE]),
-                                            )),
-                                            kind: None,
-                                            encoding: None,
-                                        }),
-                                    };
-                                    query.reply(sample).await;
-                                }
-                                HelloRequest::Add {} => {
-                                    let resp = HelloResponse::Add(ser.add().await);
-                                    let encoded = zrpc::serialize::serialize_response(&resp)
-                                        .map_err(|_| async_std::channel::RecvError)?;
-                                    let sample = zenoh::net::Sample {
-                                        res_name: p.to_string().clone(),
-                                        payload: encoded.into(),
-                                        data_info: Some(zenoh::net::protocol::proto::DataInfo {
-                                            source_id: None,
-                                            source_sn: None,
-                                            first_router_id: None,
-                                            first_router_sn: None,
-                                            timestamp: Some(uhlc::Timestamp::new(
-                                                Default::default(),
-                                                uhlc::ID::new(16, [1u8; uhlc::ID::MAX_SIZE]),
-                                            )),
-                                            kind: None,
-                                            encoding: None,
-                                        }),
-                                    };
-                                    query.reply(sample).await;
-                                }
-                            }
-                        }
-                    };
-
-                    let res = rcv_loop
-                        .race(_stop.recv())
-                        .await
-                        .map_err(|e| ZRPCError::Error(format!("{}", e)));
-                    res
-                }
-                _ => Err(ZRPCError::StateTransitionNotAllowed(
-                    "State is not WORK, serve called directly? serve is called by calling work!"
-                        .to_string(),
-                )),
-            }
-        }
-        let res = __serve(self, stop, barrier);
-        Box::pin(res)
-    }
-    #[allow(clippy::type_complexity, clippy::manual_async_fn)]
-    fn stop(
-        &self,
-        stop: async_std::channel::Sender<()>,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-        async fn __stop<S>(
-            _self: &ServeHello<S>,
-            _stop: async_std::channel::Sender<()>,
-        ) -> ZRPCResult<()>
-        where
-            S: Hello + Send + 'static,
-        {
-            let mut ci = _self.state.write().await;
-            match ci.status {
-                zrpc::ComponentStatus::SERVING => {
-                    ci.status = zrpc::ComponentStatus::REGISTERED;
-                    drop(ci);
-                    Ok(_stop.send(()).await?)
-                }
-                _ => Err(ZRPCError::StateTransitionNotAllowed(
-                    "Cannot stop a component in a state different than WORK".to_string(),
-                )),
-            }
-        }
-        Box::pin(__stop(self, stop))
-    }
-    #[allow(clippy::type_complexity, clippy::manual_async_fn)]
-    fn unregister(
-        &self,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-        async fn __unregister<S>(_self: &ServeHello<S>) -> ZRPCResult<()>
-        where
-            S: Hello + Send + 'static,
-        {
-            let mut ci = _self.state.write().await;
-            match ci.status {
-                zrpc::ComponentStatus::REGISTERED => {
-                    ci.status = zrpc::ComponentStatus::HALTED;
-                    Ok(())
-                }
-                _ => Err(ZRPCError::StateTransitionNotAllowed(
-                    "Cannot unregister a component in a state different than REGISTERED"
-                        .to_string(),
-                )),
-            }
-        }
-        Box::pin(__unregister(self))
-    }
-    #[allow(clippy::type_complexity, clippy::manual_async_fn)]
-    fn disconnect(
-        &self,
-        stop: async_std::channel::Sender<()>,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-        async fn __disconnect<S>(
-            _self: &ServeHello<S>,
-            _stop: async_std::channel::Sender<()>,
-        ) -> ZRPCResult<()>
-        where
-            S: Hello + Send + 'static,
-        {
-            let mut ci = _self.state.write().await;
-            match ci.status {
-                zrpc::ComponentStatus::HALTED => {
-                    ci.status = zrpc::ComponentStatus::HALTED;
-                    drop(ci);
-                    Ok(_stop.send(()).await?)
-                }
-                _ => Err(ZRPCError::StateTransitionNotAllowed(
-                    "Cannot disconnect a component in a state different than HALTED".to_string(),
-                )),
-            }
-        }
-        Box::pin(__disconnect(self, stop))
-    }
-}
-
-/// The request sent over the wire from the client to the server.
-#[derive(Clone, Debug, Serialize, Deserialize)]
-pub enum HelloRequest {
-    Hello { name: String },
-    Add {},
-}
-
-/// The response sent over the wire from the server to the client.
-#[derive(Clone, Debug, Serialize, Deserialize)]
-pub enum HelloResponse {
-    Hello(String),
-    Add(u64),
-}
-
-#[allow(unused)]
-#[derive(Clone, Debug)]
-pub struct HelloClient<C = zrpc::ZNClientChannel<HelloRequest, HelloResponse>> {
-    ch: C,
-    server_uuid: Uuid,
-}
-
-impl HelloClient {
-    pub fn new(
-        z: async_std::sync::Arc<zenoh::net::Session>,
-        instance_id: uuid::Uuid,
-    ) -> HelloClient {
-        let new_client = zrpc::ZNClientChannel::new(
-            z,
-            "/znservice/Hello/2967c40b-a9a4-4330-b5f6-e0315b2356a9/".to_string(),
-            Some(instance_id),
-        );
-        HelloClient {
-            ch: new_client,
-            server_uuid: instance_id,
-        }
-    }
-    pub fn get_server_uuid(&self) -> Uuid {
-        self.server_uuid
-    }
-    pub fn find_servers(
-        z: async_std::sync::Arc<zenoh::net::Session>,
-    ) -> impl std::future::Future<Output = ZRPCResult<Vec<uuid::Uuid>>> + 'static {
-        async move {
-            let reskey = net::ResKey::RId(
-                z.declare_resource(&net::ResKey::RName(
-                    "/znservice/Hello/2967c40b-a9a4-4330-b5f6-e0315b2356a9/*/state".to_string(),
-                ))
-                .await?,
-            );
-            let mut servers = Vec::new();
-            let mut replies = z
-                .query(
-                    &reskey,
-                    "",
-                    net::QueryTarget::default(),
-                    net::QueryConsolidation::default(),
-                )
-                .await?;
-            while let Some(d) = replies.next().await {
-                let buf = d.data.payload;
-                let ca = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                servers.push(ca.uuid);
-            }
-            Ok(servers)
-        }
-    }
-    pub fn find_local_servers(
-        z: async_std::sync::Arc<zenoh::net::Session>,
-    ) -> impl std::future::Future<Output = ZRPCResult<Vec<uuid::Uuid>>> + 'static {
-        async move {
-            let reskey = net::ResKey::RId(
-                z.declare_resource(&net::ResKey::RName(
-                    "/znservice/Hello/2967c40b-a9a4-4330-b5f6-e0315b2356a9/*/state".to_string(),
-                ))
-                .await?,
-            );
-            let mut servers = Vec::new();
-            let mut replies = z
-                .query(
-                    &reskey,
-                    "",
-                    net::QueryTarget::default(),
-                    net::QueryConsolidation::default(),
-                )
-                .await?;
-            while let Some(d) = replies.next().await {
-                let buf = d.data.payload;
-                let ca = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                servers.push(ca);
-            }
-            let zinfo = z.info().await;
-            let rid = match zinfo.get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY) {
-                Some(r_info) => {
-                    if r_info != "" {
-                        r_info.split(",").collect::<Vec<_>>()[0].to_uppercase()
-                    } else {
-                        return Err(ZRPCError::NoRouter);
-                    }
-                }
-                None => return Err(ZRPCError::NoRouter),
-            };
-
-            let reskey = net::ResKey::RId(
-                z.declare_resource(&net::ResKey::RName(format!("/@/router/{}", rid)))
-                    .await?,
-            );
-            let rdata: Vec<zenoh::net::Reply> = z
-                .query(
-                    &reskey,
-                    "",
-                    net::QueryTarget::default(),
-                    net::QueryConsolidation::default(),
-                )
-                .await?
-                .collect()
-                .await;
-            if rdata.len() == 0 {
-                return Err(ZRPCError::NotFound);
-            }
-            let router_data = &rdata[0].data;
-            let reply_encoding = if let Some(info) = router_data.data_info.clone() {
-                info.encoding
-                    .unwrap_or(zenoh::net::protocol::proto::encoding::APP_OCTET_STREAM)
-            } else {
-                zenoh::net::protocol::proto::encoding::APP_OCTET_STREAM
-            };
-            let router_value = zenoh::Value::decode(reply_encoding, router_data.payload.clone())?;
-            match router_value {
-                zenoh::Value::Json(sv) => {
-                    let ri = zrpc::serialize::deserialize_router_info(&sv.as_bytes())?;
-                    let r: Vec<Uuid> = servers
-                        .into_iter()
-                        .filter_map(|ci| {
-                            let pid = String::from(&ci.peerid).to_uppercase();
-                            let mut it = ri.clone().sessions.into_iter();
-                            let f = it.find(|x| x.peer == pid.clone());
-                            if f.is_none() {
-                                None
-                            } else {
-                                Some(ci.uuid)
-                            }
-                        })
-                        .collect();
-
-                    Ok(r)
-                }
-                _ => Err(ZRPCError::ZenohError(
-                    "Router information is not encoded in JSON".to_string(),
-                )),
-            }
-        }
-    }
-}
-impl HelloClient {
-    pub fn verify_server(&self) -> impl std::future::Future<Output = ZRPCResult<bool>> + '_ {
-        async move { self.ch.verify_server().await }
-    }
-    #[allow(unused, clippy::manual_async_fn)]
-    pub fn hello(
-        &self,
-        name: String,
-    ) -> impl std::future::Future<Output = ZRPCResult<String>> + '_ {
-        let request = HelloRequest::Hello { name };
-        async move {
-            let resp = self.ch.call_fun(request);
-            let dur = std::time::Duration::from_secs(60u16 as u64);
-            match async_std::future::timeout(dur, resp).await {
-                Ok(r) => match r {
-                    Ok(zr) => match zr {
-                        HelloResponse::Hello(msg) => std::result::Result::Ok(msg),
-                        _ => Err(ZRPCError::Unreachable),
-                    },
-                    Err(e) => Err(e),
-                },
-                Err(e) => Err(ZRPCError::TimedOut),
-            }
-        }
-    }
-    #[allow(unused, clippy::manual_async_fn)]
-    pub fn add(&self) -> impl std::future::Future<Output = ZRPCResult<u64>> + '_ {
-        let request = HelloRequest::Add {};
-        async move {
-            let resp = self.ch.call_fun(request);
-            let dur = std::time::Duration::from_secs(60u16 as u64);
-            match async_std::future::timeout(dur, resp).await {
-                Ok(r) => match r {
-                    Ok(zr) => match zr {
-                        HelloResponse::Add(msg) => std::result::Result::Ok(msg),
-                        _ => Err(ZRPCError::Unreachable),
-                    },
-                    Err(e) => Err(e),
-                },
-                Err(e) => Err(ZRPCError::TimedOut),
-            }
-        }
-    }
-}
-
-#[derive(Clone, Debug)]
-struct HelloZService {
-    pub ser_name: String,
-    pub counter: Arc<Mutex<u64>>,
-}
-
-impl Hello for HelloZService {
-    #[allow(unused, clippy::manual_async_fn)]
-    fn hello(
-        &self,
-        name: String,
-    ) -> ::core::pin::Pin<Box<dyn ::core::future::Future<Output = String> + core::marker::Send + '_>>
-    {
-        async fn __hello(_self: &HelloZService, name: String) -> String {
-            {
-                format!("Hello {}!, you are connected to {}", name, _self.ser_name)
-            }
-        }
-        Box::pin(__hello(self, name))
-    }
-    #[allow(unused, clippy::manual_async_fn)]
-    fn add(
-        &mut self,
-    ) -> ::core::pin::Pin<Box<dyn ::core::future::Future<Output = u64> + core::marker::Send + '_>>
-    {
-        async fn __add(mut _self: &HelloZService) -> u64 {
-            let mut guard = _self.counter.lock().await;
-            *guard += 1;
-            *guard
-        }
-        Box::pin(__add(self))
-    }
-}
-
-#[async_std::main]
-async fn main() {
-    {
-        env_logger::init();
-        let zproperties = Properties::from("mode=peer");
-        let zsession = Arc::new(zenoh::net::open(zproperties.into()).await.unwrap());
-
-        let service = HelloZService {
-            ser_name: "test service".to_string(),
-            counter: Arc::new(Mutex::new(0u64)),
-        };
-
-        let z = zsession.clone();
-        let server = service.get_hello_server(z, None);
-
-        let ser_uuid = server.instance_uuid();
-        println!("Server instance UUID {}", ser_uuid);
-        let client = HelloClient::new(zsession.clone(), ser_uuid);
-
-        let (stopper, _h) = server.connect().await.unwrap();
-
-        server.initialize().await.unwrap();
-        server.register().await.unwrap();
-        println!("Verify server: {:?}", client.verify_server().await);
-
-        let (s, handle) = server.start().await.unwrap();
-
-        let servers = HelloClient::find_servers(zsession.clone()).await;
-        println!("servers found: {:?}", servers);
-
-        let local_servers = HelloClient::find_local_servers(zsession.clone()).await;
-
-        println!("local_servers found: {:?}", local_servers);
-
-        println!("Verify server: {:?}", client.verify_server().await);
-        task::sleep(Duration::from_secs(1)).await;
-
-        println!("Verify server: {:?}", client.verify_server().await);
-
-        let hello = client.hello("client".to_string()).await;
-        println!("Res is: {:?}", hello);
-        let res = client.add().await;
-        println!("Res is: {:?}", res);
-
-        let res = client.add().await;
-        println!("Res is: {:?}", res);
-
-        let res = client.add().await;
-        println!("Res is: {:?}", res);
-
-        server.stop(s).await.unwrap();
-        server.unregister().await.unwrap();
-        server.disconnect(stopper).await.unwrap();
-        handle.await.unwrap();
-    }
-}
diff --git a/znrpc-macros/examples/znservice.rs b/znrpc-macros/examples/znservice.rs
deleted file mode 100644
index 9178aed8..00000000
--- a/znrpc-macros/examples/znservice.rs
+++ /dev/null
@@ -1,116 +0,0 @@
-#![allow(clippy::manual_async_fn)]
-#![allow(clippy::large_enum_variant)]
-
-#[macro_use]
-extern crate std;
-
-use async_std::prelude::FutureExt;
-use async_std::sync::{Arc, Mutex};
-use async_std::task;
-use futures::prelude::*;
-use std::convert::TryFrom;
-use std::str;
-use std::time::Duration;
-use uuid::Uuid;
-use zenoh::*;
-
-//importing the macros
-use znrpc_macros::{znserver, znservice};
-use zrpc::zrpcresult::{ZRPCError, ZRPCResult};
-use zrpc::ZNServe;
-
-#[znservice(timeout_s = 60, prefix = "/lfos")]
-pub trait Hello {
-    async fn hello(&self, name: String) -> String;
-    async fn add(&mut self) -> u64;
-}
-
-#[derive(Clone)]
-struct HelloZService {
-    pub ser_name: String,
-    pub counter: Arc<Mutex<u64>>,
-}
-
-#[znserver]
-impl Hello for HelloZService {
-    async fn hello(&self, name: String) -> String {
-        format!("Hello {}!, you are connected to {}", name, self.ser_name)
-    }
-
-    async fn add(&mut self) -> u64 {
-        let mut guard = self.counter.lock().await;
-        *guard += 1;
-        *guard
-    }
-}
-
-#[async_std::main]
-async fn main() {
-    env_logger::init();
-    let zproperties = Properties::from("mode=peer");
-    let zsession = Arc::new(zenoh::net::open(zproperties.into()).await.unwrap());
-    let service = HelloZService {
-        ser_name: "test service".to_string(),
-        counter: Arc::new(Mutex::new(0u64)),
-    };
-
-    let z = zsession.clone();
-
-    let server = service.get_hello_server(z, None);
-    let ser_uuid = server.instance_uuid();
-    println!("Server instance UUID {}", ser_uuid);
-    let client = HelloClient::new(zsession.clone(), ser_uuid);
-
-    let (stopper, _h) = server.connect().await.unwrap();
-    server.initialize().await.unwrap();
-    server.register().await.unwrap();
-
-    // let servers = HelloClient::find_servers(zsession.clone()).await;
-    // println!("servers found: {:?}", servers);
-
-    // this should return an error as the server is not ready
-    // let hello = client.hello("client".to_string()).await;
-    // println!("Res is: {:?}", hello);
-
-    println!("Verify server: {:?}", client.verify_server().await);
-
-    let (s, handle) = server.start().await.unwrap();
-
-    let servers = HelloClient::find_servers(zsession.clone()).await;
-    println!("servers found: {:?}", servers);
-
-    let local_servers = HelloClient::find_local_servers(zsession.clone()).await;
-    println!("local_servers found: {:?}", local_servers);
-
-    println!("Verify server: {:?}", client.verify_server().await);
-
-    task::sleep(Duration::from_secs(1)).await;
-
-    println!("Verify server: {:?}", client.verify_server().await);
-
-    let hello = client.hello("client".to_string()).await;
-    println!("Res is: {:?}", hello);
-
-    let res = client.add().await;
-    println!("Res is: {:?}", res);
-
-    let res = client.add().await;
-    println!("Res is: {:?}", res);
-
-    let res = client.add().await;
-    println!("Res is: {:?}", res);
-
-    server.stop(s).await.unwrap();
-
-    // let servers = HelloClient::find_servers(zsession.clone()).await;
-    // println!("servers found: {:?}", servers);
-
-    server.unregister().await.unwrap();
-    server.disconnect(stopper).await.unwrap();
-
-    handle.await.unwrap();
-
-    // this should return an error as the server is not there
-    // let hello = client.hello("client".to_string()).await;
-    // println!("Res is: {:?}", hello);
-}
diff --git a/znrpc-macros/src/lib.rs b/znrpc-macros/src/lib.rs
deleted file mode 100644
index b129a1ef..00000000
--- a/znrpc-macros/src/lib.rs
+++ /dev/null
@@ -1,1256 +0,0 @@
-/*********************************************************************************
-* Copyright (c) 2018,2020 ADLINK Technology Inc.
-*
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License 2.0 which is available at
-* http://www.eclipse.org/legal/epl-2.0, or the Apache Software License 2.0
-* which is available at https://www.apache.org/licenses/LICENSE-2.0.
-*
-* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
-* Contributors:
-*   ADLINK fog05 team, <fog05@adlink-labs.tech>
-*********************************************************************************/
-#![allow(clippy::upper_case_acronyms)]
-#![recursion_limit = "512"]
-
-extern crate base64;
-extern crate darling;
-extern crate proc_macro;
-extern crate proc_macro2;
-extern crate quote;
-extern crate serde;
-extern crate syn;
-
-use darling::FromMeta;
-use inflector::cases::snakecase::to_snake_case;
-use proc_macro::TokenStream;
-use proc_macro2::{Span, TokenStream as TokenStream2};
-use quote::{format_ident, quote, quote_spanned, ToTokens};
-use std::str::FromStr;
-use syn::visit_mut::VisitMut;
-use syn::{
-    braced,
-    ext::IdentExt,
-    parenthesized,
-    parse::{Parse, ParseStream},
-    parse_macro_input, parse_quote,
-    spanned::Spanned,
-    token::Comma,
-    Attribute, AttributeArgs, Block, FnArg, Ident, ImplItem, ImplItemMethod, ImplItemType,
-    ItemImpl, Pat, PatIdent, PatType, Receiver, ReturnType, Signature, Token, Type, Visibility,
-};
-use syn_serde::json;
-use uuid::Uuid;
-
-mod receiver;
-use receiver::ReplaceReceiver;
-
-macro_rules! extend_errors {
-    ($errors: ident, $e: expr) => {
-        match $errors {
-            Ok(_) => $errors = Err($e),
-            Err(ref mut errors) => errors.extend($e),
-        }
-    };
-}
-
-#[derive(Debug, FromMeta)]
-struct ZNServiceMacroArgs {
-    timeout_s: u16,
-    #[darling(default)]
-    prefix: Option<String>,
-    #[darling(default)]
-    service_uuid: Option<String>,
-}
-
-struct ZNService {
-    attrs: Vec<Attribute>,
-    vis: Visibility,
-    ident: Ident,
-    evals: Vec<EvalMethod>,
-}
-
-impl Parse for ZNService {
-    fn parse(input: ParseStream) -> syn::Result<Self> {
-        let attrs = input.call(Attribute::parse_outer)?;
-        let vis = input.parse()?;
-        input.parse::<Token![trait]>()?;
-        let ident: Ident = input.parse()?;
-        let content;
-        braced!(content in input);
-        let mut evals = Vec::<EvalMethod>::new();
-        while !content.is_empty() {
-            evals.push(content.parse()?);
-        }
-        let mut ident_errors = Ok(());
-        for eval in &evals {
-            if eval.ident == "new" {
-                extend_errors!(
-                    ident_errors,
-                    syn::Error::new(
-                        eval.ident.span(),
-                        format!(
-                            "method name conflicts with generated fn `{}Client::new`",
-                            ident.unraw()
-                        )
-                    )
-                );
-            }
-            if eval.ident == "serve" {
-                extend_errors!(
-                    ident_errors,
-                    syn::Error::new(
-                        eval.ident.span(),
-                        format!("method name conflicts with generated fn `{}::serve`", ident)
-                    )
-                );
-            }
-        }
-        ident_errors?;
-
-        Ok(Self {
-            attrs,
-            vis,
-            ident,
-            evals,
-        })
-    }
-}
-
-struct EvalMethod {
-    attrs: Vec<Attribute>,
-    ident: Ident,
-    receiver: Receiver,
-    args: Vec<PatType>,
-    output: ReturnType,
-}
-
-impl Parse for EvalMethod {
-    fn parse(input: ParseStream) -> syn::Result<Self> {
-        let attrs = input.call(Attribute::parse_outer)?;
-        input.parse::<Token![async]>()?;
-        input.parse::<Token![fn]>()?;
-        let ident = input.parse()?;
-        let content;
-        let mut recv: Option<Receiver> = None;
-        parenthesized!(content in input);
-        let mut args = Vec::new();
-        let mut errors = Ok(());
-        for arg in content.parse_terminated::<FnArg, Comma>(FnArg::parse)? {
-            match arg {
-                FnArg::Typed(captured) if matches!(&*captured.pat, Pat::Ident(_)) => {
-                    args.push(captured);
-                }
-                FnArg::Typed(captured) => {
-                    extend_errors!(
-                        errors,
-                        syn::Error::new(captured.pat.span(), "patterns aren't allowed in RPC args")
-                    );
-                }
-                FnArg::Receiver(receiver) => {
-                    //Should take whatever used by the user and strip it for client
-                    recv = Some(receiver)
-                    // extend_errors!(
-                    //     errors,
-                    //     syn::Error::new(arg.span(), "method args cannot start with self, &mut self is added by the macro!")
-                    // );
-                }
-            }
-        }
-        match recv {
-            None => extend_errors!(
-                errors,
-                syn::Error::new(
-                    recv.span(),
-                    "Missing any receiver in method declaration, please add one!"
-                )
-            ),
-            Some(_) => (),
-        }
-
-        errors?;
-        let output = input.parse()?;
-        input.parse::<Token![;]>()?;
-        let receiver = recv.unwrap();
-        Ok(Self {
-            attrs,
-            ident,
-            receiver,
-            args,
-            output,
-        })
-    }
-}
-
-#[proc_macro_derive(Ast)]
-pub fn derive_ast(item: TokenStream) -> TokenStream {
-    let ast: syn::DeriveInput = syn::parse(item).unwrap();
-    let exp: syn::File = syn::parse_quote! {
-        #ast
-    };
-
-    println!("{}", json::to_string_pretty(&exp));
-    TokenStream::new()
-}
-
-/// Generates:
-/// - service trait
-/// - serve fn
-/// - client stub struct
-/// - new_stub client factory fn
-/// - Request and Response enums
-#[proc_macro_attribute]
-pub fn znservice(attr: TokenStream, input: TokenStream) -> TokenStream {
-    let unit_type: &Type = &parse_quote!(());
-
-    //parsing the trait body
-    let ZNService {
-        ref attrs,
-        ref vis,
-        ref ident,
-        ref evals,
-    } = parse_macro_input!(input as ZNService);
-
-    //parsing the attributes to the macro
-    let attr_args = parse_macro_input!(attr as AttributeArgs);
-    let macro_args = match ZNServiceMacroArgs::from_list(&attr_args) {
-        Ok(v) => v,
-        Err(e) => {
-            return TokenStream::from(e.write_errors());
-        }
-    };
-
-    //converts the functions names from snake_case to CamelCase
-    let camel_case_fn_names: &Vec<_> = &evals
-        .iter()
-        .map(|eval| snake_to_camel(&eval.ident.unraw().to_string()))
-        .collect();
-
-    let snake_case_ident = to_snake_case(&ident.unraw().to_string());
-
-    // Collects the pattern for the types
-    let args: &[&[PatType]] = &evals.iter().map(|eval| &*eval.args).collect::<Vec<_>>();
-
-    let service_uuid = match macro_args.service_uuid {
-        Some(u) => Uuid::from_str(&u).unwrap(),
-        None => Uuid::new_v4(),
-    };
-
-    //service eval path
-    let path = match macro_args.prefix {
-        Some(prefix) => format!("{}/znservice/{}/{}/", prefix, ident, service_uuid),
-        None => format!("/znservice/{}/{}/", ident, service_uuid),
-    };
-
-    let service_name = format!("{}Service", ident);
-    // Generates the code
-    let ts: TokenStream = ZNServiceGenerator {
-        service_ident: ident,
-        server_ident: &format_ident!("Serve{}", ident), //Server is called Serve<Trait Name>
-        client_ident: &format_ident!("{}Client", ident), //Client is called <Trait Name>Client
-        request_ident: &format_ident!("{}Request", ident), //Request type is called <Trait Name>Request
-        response_ident: &format_ident!("{}Response", ident), //Response type is called <Trait Name>Response
-        vis,
-        args,
-        method_attrs: &evals.iter().map(|eval| &*eval.attrs).collect::<Vec<_>>(), //getting evals attributes
-        method_idents: &evals.iter().map(|eval| &eval.ident).collect::<Vec<_>>(), //getting evals names
-        attrs,
-        evals,
-        return_types: &evals //getting evals return type, if non present using unit
-            .iter()
-            .map(|eval| match eval.output {
-                ReturnType::Type(_, ref ty) => ty,
-                ReturnType::Default => unit_type,
-            })
-            .collect::<Vec<_>>(),
-        arg_pats: &args
-            .iter()
-            .map(|args| args.iter().map(|arg| &*arg.pat).collect())
-            .collect::<Vec<_>>(),
-        camel_case_idents: &evals
-            .iter()
-            .zip(camel_case_fn_names.iter())
-            .map(|(eval, name)| Ident::new(name, eval.ident.span()))
-            .collect::<Vec<_>>(),
-        timeout: &macro_args.timeout_s,
-        eval_path: &path,
-        service_name: &service_name,
-        service_get_server_ident: &format_ident!("get_{}_server", snake_case_ident),
-    }
-    .into_token_stream()
-    .into();
-    ts
-}
-
-/// Update the implementation of the trait
-///
-/// Modifies the method in a similar way to what async_trait does
-/// This impl:
-///
-/// #[znserver]
-/// impl Hello for Server {
-///     async pub fn hello(&self, param : String) -> String {
-///         format!("Hello {} from {}", param, self)
-///     }
-/// }
-///
-/// Should become something like:
-///
-/// impl Hello for Server {
-///     pub fn hello(&self, param : String) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = String> + '_ >> {
-///         async fn __hello(_self : &Server, param : String) -> String {
-///             format!("Hello {} from {}", param, self)
-///         }
-///         Box::pin(__hello(self,param))
-///     }
-/// }
-#[proc_macro_attribute]
-pub fn znserver(_attr: TokenStream, input: TokenStream) -> TokenStream {
-    let mut item = syn::parse_macro_input!(input as ItemImpl);
-    let span = item.span();
-
-    // let attr_args = parse_macro_input!(_attr as AttributeArgs);
-
-    let mut expected_non_async_types: Vec<(&ImplItemMethod, String)> = Vec::new();
-    let mut found_non_async_types: Vec<&ImplItemType> = Vec::new();
-
-    for inner in &mut item.items {
-        match inner {
-            ImplItem::Method(method) => {
-                if method.sig.asyncness.is_some() {
-                    // if this function is declared async, transform it into a regular function
-                    //method.sig.asyncness = None;
-                    // put the body inside an task::block_on(async {})
-                    /*
-                    let content = method.block.to_token_stream();
-
-                    let updated_impl = TokenStream::from(quote! {
-                        {
-                            task::block_on(
-                                async move
-                                #content
-                            )
-                        }
-                    });
-                    // and add the  #[allow(unused,clippy::manual_async_fn)] attribute
-                    method
-                        .attrs
-                        .push(parse_quote!(#[allow(unused,clippy::manual_async_fn)]));
-                    method.block = parse_macro_input!(updated_impl as Block);
-                    */
-                    let sig = &mut method.sig;
-                    let block = &mut method.block;
-                    transform_server_method_block(sig, block, &item.self_ty);
-                    transform_server_method_sig(sig);
-                    method
-                        .attrs
-                        .push(parse_quote!(#[allow(unused,clippy::manual_async_fn)]));
-                } else {
-                    // If it's not async, keep track of all required associated types for better
-                    // error reporting.
-                    expected_non_async_types.push((method, associated_type_for_eval(method)));
-                }
-            }
-            ImplItem::Type(typedecl) => found_non_async_types.push(typedecl),
-            _ => {}
-        }
-    }
-
-    if let Err(e) =
-        verify_types_were_provided(span, &expected_non_async_types, &found_non_async_types)
-    {
-        return TokenStream::from(e.to_compile_error());
-    }
-
-    TokenStream::from(quote!(#item))
-}
-
-/// Transforms the method signature for the server
-/// to return a Pin<Box<dyn Future<Output = #old_return_type > + Send + '_ >>
-fn transform_server_method_sig(sig: &mut Signature) {
-    let ret = match &sig.output {
-        ReturnType::Default => quote!(()),
-        ReturnType::Type(_, ret) => quote!(#ret),
-    };
-
-    sig.output = parse_quote! {
-        -> ::core::pin::Pin<Box<dyn ::core::future::Future<Output = #ret> + core::marker::Send + '_ >>
-    };
-    sig.asyncness = None;
-}
-
-fn transform_server_method_block(sig: &mut Signature, block: &mut Block, receiver: &Type) {
-    let inner_ident = format_ident!("__{}", sig.ident);
-
-    let args = sig.inputs.iter().enumerate().map(|(i, arg)| match arg {
-        FnArg::Receiver(Receiver { self_token, .. }) => quote!(#self_token),
-        FnArg::Typed(arg) => {
-            if let Pat::Ident(PatIdent { ident, .. }) = &*arg.pat {
-                quote!(#ident)
-            } else {
-                format_ident!("__arg{}", i).into_token_stream()
-            }
-        }
-    });
-
-    let mut standalone = sig.clone();
-    standalone.ident = inner_ident.clone();
-
-    match standalone.inputs.iter_mut().next() {
-        Some(
-            arg @ FnArg::Receiver(Receiver {
-                reference: Some(_), ..
-            }),
-        ) => {
-            let (self_token, mutability) = match arg {
-                FnArg::Receiver(Receiver {
-                    mutability,
-                    self_token,
-                    ..
-                }) => (self_token, mutability),
-                _ => unreachable!(),
-            };
-            let under_self = Ident::new("_self", self_token.span);
-            *arg = parse_quote! {
-                #mutability #under_self: &#receiver
-            };
-        }
-        Some(arg @ FnArg::Receiver(_)) => {
-            let (self_token, mutability) = match arg {
-                FnArg::Receiver(Receiver {
-                    mutability,
-                    self_token,
-                    ..
-                }) => (self_token, mutability),
-                _ => unreachable!(),
-            };
-            let under_self = Ident::new("_self", self_token.span);
-            *arg = parse_quote! {
-                #mutability #under_self: #receiver
-            };
-        }
-        Some(FnArg::Typed(arg)) => {
-            if let Pat::Ident(arg) = &mut *arg.pat {
-                if arg.ident == "self" {
-                    arg.ident = Ident::new("_self", arg.ident.span());
-                }
-            }
-        }
-        _ => {}
-    }
-
-    let mut replace = ReplaceReceiver::with_as_trait(receiver.clone(), None);
-    replace.visit_signature_mut(&mut standalone);
-    replace.visit_block_mut(block);
-
-    let brace = block.brace_token;
-    let box_pin = quote_spanned!(
-        brace.span => {
-            #standalone #block
-            Box::pin(#inner_ident(#(#args),*))
-    });
-    *block = parse_quote!(#box_pin);
-    block.brace_token = brace;
-}
-
-/// Creates the type name for a future, to be removed...
-fn associated_type_for_eval(method: &ImplItemMethod) -> String {
-    snake_to_camel(&method.sig.ident.unraw().to_string()) + "Fut"
-}
-
-/// Verifies if the types are provide for each methods
-fn verify_types_were_provided(
-    span: Span,
-    expected: &[(&ImplItemMethod, String)],
-    provided: &[&ImplItemType],
-) -> syn::Result<()> {
-    let mut result = Ok(());
-    for (method, expected) in expected {
-        if !provided.iter().any(|typedecl| typedecl.ident == expected) {
-            let mut e = syn::Error::new(
-                span,
-                format!("not all trait items implemented, missing: `{}`", expected),
-            );
-            let fn_span = method.sig.fn_token.span();
-            e.extend(syn::Error::new(
-                fn_span.join(method.sig.ident.span()).unwrap_or(fn_span),
-                format!(
-                    "hint: `#[znerver]` only rewrites async fns, and `fn {}` is not async",
-                    method.sig.ident
-                ),
-            ));
-            match result {
-                Ok(_) => result = Err(e),
-                Err(ref mut error) => error.extend(Some(e)),
-            }
-        }
-    }
-    result
-}
-
-/// Generator for the ZNService
-struct ZNServiceGenerator<'a> {
-    service_ident: &'a Ident,            //service type
-    server_ident: &'a Ident,             //server type
-    client_ident: &'a Ident,             //client type
-    request_ident: &'a Ident,            //request type
-    response_ident: &'a Ident,           //response type
-    vis: &'a Visibility,                 //visibility
-    attrs: &'a [Attribute],              //attributes
-    evals: &'a [EvalMethod],             //functions to be exposed via evals
-    camel_case_idents: &'a [Ident],      //camel case conversion of all names
-    method_idents: &'a [&'a Ident],      //type of the methods
-    method_attrs: &'a [&'a [Attribute]], //attributes of the methods
-    args: &'a [&'a [PatType]],           // types description pattern
-    return_types: &'a [&'a Type],        // return types of functions
-    arg_pats: &'a [Vec<&'a Pat>],        // patterns for args
-    timeout: &'a u16,                    //eval timeout
-    eval_path: &'a String,               //path for evals
-    service_name: &'a String,            //service name on zenoh
-    service_get_server_ident: &'a Ident, //the ident for the get_<trait>_server
-}
-
-impl<'a> ZNServiceGenerator<'a> {
-    // crates the service trait
-    fn trait_service(&self) -> TokenStream2 {
-        let &Self {
-            attrs,
-            evals,
-            vis,
-            return_types,
-            service_ident,
-            server_ident,
-            service_get_server_ident,
-            ..
-        } = self;
-
-        let fns = evals.iter().zip(return_types.iter()).map(
-            |(
-                EvalMethod {
-                    attrs,
-                    ident,
-                    receiver,
-                    args,
-                    ..
-                },
-                output,
-            )| {
-                quote! {
-
-                    #(#attrs)*
-                    //fn #ident(#receiver, #(#args),*) ->  #output;
-                    fn #ident(#receiver, #(#args),*) ->  ::core::pin::Pin<Box<dyn ::core::future::Future<Output = #output> + core::marker::Send + '_ >>;
-                }
-            },
-        );
-
-        quote! {
-        #(#attrs)*
-        #vis trait #service_ident : Clone{
-            #(#fns)*
-
-            /// Returns the server object
-            fn #service_get_server_ident(self, z : async_std::sync::Arc<zenoh::net::Session>, id : Option<uuid::Uuid>) -> #server_ident<Self>{
-                let id = id.unwrap_or(Uuid::new_v4());
-                log::trace!("Getting Server with ID {}", id);
-                #server_ident::new(z,self, id)
-                }
-            }
-
-        }
-    }
-
-    //creates the server struct
-    fn struct_server(&self) -> TokenStream2 {
-        let &Self {
-            vis,
-            server_ident,
-            service_name,
-            ..
-        } = self;
-
-        quote! {
-            #[derive(Clone)]
-            #vis struct #server_ident<S> {
-                z : async_std::sync::Arc<zenoh::net::Session>,
-                server: S,
-                instance_id: uuid::Uuid,
-                state : async_std::sync::Arc<async_std::sync::RwLock<zrpc::ComponentState>>
-            }
-
-            impl<S> #server_ident<S> {
-                pub fn new(z : async_std::sync::Arc<zenoh::net::Session>, server : S, id : uuid::Uuid) -> Self {
-
-                    let ci = zrpc::ComponentState{
-                        uuid : id,
-                        name : format!("{}", #service_name),
-                        routerid : "".to_string(),
-                        peerid : "".to_string(),
-                        status : zrpc::ComponentStatus::HALTED,
-                    };
-
-                    Self {
-                        z,
-                        server,
-                        instance_id : id,
-                        state : async_std::sync::Arc::new(async_std::sync::RwLock::new(ci))
-                    }
-                }
-            }
-
-        }
-    }
-
-    // implements ZServe for the server
-    fn impl_serve_for_server(&self) -> TokenStream2 {
-        let &Self {
-            request_ident,
-            server_ident,
-            service_ident,
-            response_ident,
-            camel_case_idents,
-            arg_pats,
-            method_idents,
-            eval_path,
-            service_name,
-            ..
-        } = self;
-
-        quote! {
-
-
-            impl<S> zrpc::ZNServe<#request_ident> for #server_ident<S>
-            where S: #service_ident + Send +'static
-            {
-                type Resp = #response_ident;
-
-                fn instance_uuid(&self) -> uuid::Uuid {
-                    self.instance_id
-                }
-
-                #[allow(clippy::type_complexity,clippy::manual_async_fn)]
-                fn connect(&'_ self) ->
-                ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<(async_std::channel::Sender<()>, async_std::task::JoinHandle<ZRPCResult<()>>)>> + '_>> {
-                    log::trace!("Connect Service {} Instance {}", #service_name, self.instance_uuid());
-
-                    async fn __connect<S>(_self: &#server_ident<S>) -> ZRPCResult<(async_std::channel::Sender<()>, async_std::task::JoinHandle<ZRPCResult<()>>)>
-                    where
-                        S: #service_ident + Send + 'static,
-                    {
-                        let zinfo = _self.z.info().await;
-                        let pid = zinfo.get(&zenoh::net::info::ZN_INFO_PID_KEY).ok_or(ZRPCError::MissingValue)?.to_uppercase();
-                        let rid = match zinfo.get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY) {
-                            Some(r_info) => {
-                                if r_info != "" {
-                                    r_info.split(",").collect::<Vec<_>>()[0].to_uppercase()
-                                } else {
-                                    "".to_string()
-                                }
-
-                            },
-                            None => "".to_string(),
-                        };
-                        let mut ci = _self.state.write().await;
-                        ci.peerid = pid.clone().to_uppercase();
-                        drop(ci);
-                        let (s,r) = async_std::channel::bounded::<()>(1);
-
-                        let zsession = _self.z.clone();
-                        let state = _self.state.clone();
-                        let path = zenoh::Path::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-
-                        log::trace!("Spawning state responder task");
-                        let h = async_std::task::spawn(
-                            async move {
-                                log::trace!("Registering queryable on {:?}", path);
-                                let mut queryable = zsession.declare_queryable(&path.clone().into(), zenoh::net::queryable::EVAL).await?;
-                                log::trace!("Queryable registered on {:?}", path);
-                                let rcv_loop = async {
-                                    loop{
-                                        let query = queryable.stream().next().await.ok_or_else(|| async_std::channel::RecvError)?;
-                                        let ci = state.read().await;
-                                        let data = zrpc::serialize::serialize_state(&*ci).map_err(|_| async_std::channel::RecvError)?;
-                                        drop(ci);
-
-                                        let sample = zenoh::net::Sample {
-                                            res_name: path.to_string().clone(),
-                                            payload: data.into(),
-                                            data_info: Some(zenoh::net::protocol::proto::DataInfo {
-                                                source_id: None,
-                                                source_sn: None,
-                                                first_router_id: None,
-                                                first_router_sn: None,
-                                                timestamp: Some(uhlc::Timestamp::new(
-                                                    Default::default(),
-                                                    uhlc::ID::new(16, [1u8; uhlc::ID::MAX_SIZE]),
-                                                )),
-                                                kind: None,
-                                                encoding: None,
-                                            }),
-                                        };
-                                        log::trace!("Reply to state queryable!");
-                                        query.reply(sample).await;
-                                    }
-                                };
-                                log::trace!("Receiver loop started");
-                                rcv_loop.race(r.recv()).await.map_err(|e| ZRPCError::Error(format!("{}", e)))
-                            }
-                        );
-                        Ok((s,h))
-                    }
-                    Box::pin(__connect(self))
-                }
-
-
-                #[allow(clippy::type_complexity,clippy::manual_async_fn)]
-                fn initialize(&self) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-                    log::trace!("Initialize Service {} Instance {}", #service_name, self.instance_uuid());
-                    async fn __initialize<S>(_self: &#server_ident<S>) -> ZRPCResult<()>
-                    where
-                        S: #service_ident + Send + 'static,
-                    {
-                        let mut ci = _self.state.write().await;
-                        match ci.status {
-                            zrpc::ComponentStatus::HALTED =>{
-                                ci.status = zrpc::ComponentStatus::INITIALIZING;
-                                Ok(())
-                            },
-                            _ => Err(ZRPCError::StateTransitionNotAllowed("Cannot initialize a component in a state different than HALTED".to_string())),
-                        }
-
-                    }
-                    Box::pin(__initialize(self))
-                }
-
-
-                #[allow(clippy::type_complexity,clippy::manual_async_fn)]
-                fn register(&self) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>>{
-                    log::trace!("Register Service {} Instance {}", #service_name, self.instance_uuid());
-                    async fn __register<S>(_self: &#server_ident<S>) -> ZRPCResult<()>
-                    where
-                    S: #service_ident + Send + 'static,
-                    {
-                        let mut ci = _self.state.write().await;
-                        match ci.status {
-                            zrpc::ComponentStatus::INITIALIZING => {
-                                ci.status = zrpc::ComponentStatus::REGISTERED;
-                                Ok(())
-                            },
-                            _ => Err(ZRPCError::StateTransitionNotAllowed("Cannot register a component in a state different than INITIALIZING".to_string())),
-                        }
-                    }
-                    Box::pin(__register(self))
-                }
-
-                #[allow(clippy::type_complexity,clippy::manual_async_fn, clippy::needless_question_mark)]
-                fn start(
-                    &self,
-                ) -> ::core::pin::Pin<
-                    Box<
-                        dyn std::future::Future<
-                                Output = ZRPCResult<(
-                                    async_std::channel::Sender<()>,
-                                    async_std::task::JoinHandle<ZRPCResult<()>>
-                                )>> + '_>>
-                    {
-
-                    log::trace!("Start Service {} Instance {}", #service_name, self.instance_uuid());
-
-                    async fn __start<S>(
-                        _self: &#server_ident<S>,
-                    ) -> ZRPCResult<(
-                        async_std::channel::Sender<()>,
-                        async_std::task::JoinHandle<ZRPCResult<()>>,
-                    )>
-                    where
-                        S: #service_ident + Send + 'static,
-                    {
-                            let (s, r) = async_std::channel::bounded::<()>(1);
-                            let barrier = async_std::sync::Arc::new(async_std::sync::Barrier::new(2));
-                            let ci = _self.state.read().await;
-                            match ci.status {
-                                zrpc::ComponentStatus::REGISTERED => {
-                                    drop(ci);
-
-
-                                    let server = _self.clone();
-                                    let b =  barrier.clone();
-
-                                    let h = async_std::task::spawn_blocking( move || {
-                                        async_std::task::block_on(async {
-                                            server.serve(r, b).await
-                                        })
-                                    });
-                                    log::trace!("Waiting for serving loop to be ready");
-                                    barrier.wait().await;
-
-                                    // Updating status, using barrier to avoid race condition
-                                    let mut ci = _self.state.write().await;
-                                    ci.status = zrpc::ComponentStatus::SERVING;
-                                    drop(ci);
-
-                                    Ok((s,h))
-
-                                }
-                                _ => Err(ZRPCError::StateTransitionNotAllowed("Cannot start a component in a state different than REGISTERED".to_string())),
-                            }
-
-                    }
-                    Box::pin(__start(self))
-                }
-
-                #[allow(clippy::type_complexity,clippy::manual_async_fn)]
-                fn serve(
-                    &self,
-                    stop: async_std::channel::Receiver<()>,
-                    barrier : async_std::sync::Arc<async_std::sync::Barrier>,
-                ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-                    log::trace!("Serve Service {} Instance {}", #service_name, self.instance_uuid());
-                    async fn __serve<S>(_self: &#server_ident<S>, _stop: async_std::channel::Receiver<()>, _barrier : async_std::sync::Arc<async_std::sync::Barrier>) -> ZRPCResult<()>
-                    where
-                        S: #service_ident + Send + 'static,
-                    {
-
-                        let ci = _self.state.read().await;
-                        match ci.status {
-                            zrpc::ComponentStatus::REGISTERED => {
-                                drop(ci);
-                                let path = zenoh::Path::try_from(format!("{}/{}/eval",#eval_path, _self.instance_uuid()))?;
-                                log::trace!("Registering eval on {:?}", path);
-                                let mut queryable = _self.z
-                                    .declare_queryable(&path.clone().into(), zenoh::net::queryable::EVAL)
-                                    .await?;
-                                log::trace!("Registered on {:?}", path);
-                                _barrier.wait().await;
-                                let rcv_loop = async {
-                                    loop {
-                                        let query = queryable.stream().next().await.ok_or_else(|| async_std::channel::RecvError)?;
-                                        log::trace!("Received query {:?}", query);
-                                        //let base64_req = get_request.selector.properties.get("req").cloned().ok_or_else(|| async_std::channel::RecvError)?;
-                                        let base64_req = query.predicate.clone();
-                                        let b64_bytes = base64::decode(base64_req).map_err(|_| async_std::channel::RecvError)?;
-                                        let req = zrpc::serialize::deserialize_request::<#request_ident>(&b64_bytes).map_err(|_| async_std::channel::RecvError)?;
-                                        log::trace!("Received on {:?} {:?}", path, req);
-
-                                        let mut ser = _self.server.clone();
-                                        //let q = query.clone();
-                                        let p = path.clone();
-                                        //log::trace!("Spawning task to respond to {:?}", req);
-
-                                        match req.clone() {
-                                            #(
-                                                #request_ident::#camel_case_idents{#(#arg_pats),*} => {
-                                                    let resp = #response_ident::#camel_case_idents(ser.#method_idents( #(#arg_pats),*).await);
-                                                    log::trace!("Reply to {:?} {:?} with {:?}", path, req, resp);
-                                                    let encoded =  zrpc::serialize::serialize_response(&resp).map_err(|_| async_std::channel::RecvError)?;
-
-                                                    let sample = zenoh::net::Sample {
-                                                        res_name: p.to_string().clone(),
-                                                        payload: encoded.into(),
-                                                        data_info: Some(zenoh::net::protocol::proto::DataInfo {
-                                                            source_id: None,
-                                                            source_sn: None,
-                                                            first_router_id: None,
-                                                            first_router_sn: None,
-                                                            timestamp: Some(uhlc::Timestamp::new(
-                                                                Default::default(),
-                                                                uhlc::ID::new(16, [1u8; uhlc::ID::MAX_SIZE]),
-                                                            )),
-                                                            kind: None,
-                                                            encoding: None,
-                                                        }),
-                                                    };
-                                                    query.reply(sample).await;
-                                                    log::trace!("Response {:?} sent", resp);
-                                                }
-                                            )*
-                                        }
-                                    }
-                                };
-                                log::trace!("RPC Receiver loop started...");
-                                let res = rcv_loop.race(_stop.recv()).await.map_err(|e| ZRPCError::Error(format!("{}", e)));
-                                log::trace!("RPC Receiver loop existing  with {:?}", res);
-                                res
-                            }
-                            _ => Err(ZRPCError::StateTransitionNotAllowed("State is not WORK, serve called directly? serve is called by calling work!".to_string())),
-                        }
-                    }
-                    let res  = __serve(self, stop, barrier);
-                    Box::pin(res)
-                }
-
-                #[allow(clippy::type_complexity,clippy::manual_async_fn)]
-                fn stop(
-                    &self,
-                    stop: async_std::channel::Sender<()>,
-                ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-                    log::trace!("Stop Service {} Instance {}", #service_name, self.instance_uuid());
-                    async fn __stop<S>(_self: &#server_ident<S>, _stop: async_std::channel::Sender<()>) -> ZRPCResult<()>
-                    where
-                        S: #service_ident + Send + 'static,
-                    {
-                        let mut ci = _self.state.write().await;
-                        match ci.status {
-                            zrpc::ComponentStatus::SERVING => {
-                                ci.status = zrpc::ComponentStatus::REGISTERED;
-                                drop(ci);
-                                Ok(_stop.send(()).await?)
-                            },
-                            _ => Err(ZRPCError::StateTransitionNotAllowed("Cannot stop a component in a state different than WORK".to_string())),
-                        }
-                    }
-                    Box::pin(__stop(self, stop))
-                }
-
-                #[allow(clippy::type_complexity,clippy::manual_async_fn)]
-                fn unregister(&self) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-                    log::trace!("Unregister Service {} Instance {}", #service_name, self.instance_uuid());
-                    async fn __unregister<S>(_self: &#server_ident<S>) -> ZRPCResult<()>
-                    where
-                        S: #service_ident + Send + 'static,
-                    {
-                        let mut ci = _self.state.write().await;
-                        match ci.status {
-                            zrpc::ComponentStatus::REGISTERED =>{
-                                ci.status = zrpc::ComponentStatus::HALTED;
-                                Ok(())
-                            },
-                            _ => Err(ZRPCError::StateTransitionNotAllowed("Cannot unregister a component in a state different than REGISTERED".to_string())),
-                        }
-                    }
-                    Box::pin(__unregister(self))
-                }
-
-                #[allow(clippy::type_complexity,clippy::manual_async_fn)]
-                fn disconnect(&self, stop: async_std::channel::Sender<()>) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-                    log::trace!("Disconnect Service {} Instance {}", #service_name, self.instance_uuid());
-                    async fn __disconnect<S>(_self: &#server_ident<S>, _stop: async_std::channel::Sender<()>) -> ZRPCResult<()>
-                    where
-                        S: #service_ident + Send + 'static,
-                        {
-                            let mut ci = _self.state.write().await;
-                            match ci.status {
-                                zrpc::ComponentStatus::HALTED => {
-                                    ci.status = zrpc::ComponentStatus::HALTED;
-                                    drop(ci);
-                                    Ok(_stop.send(()).await?)
-                                },
-                                _ => Err(ZRPCError::StateTransitionNotAllowed("Cannot disconnect a component in a state different than HALTED".to_string())),
-                            }
-                        }
-                    Box::pin(__disconnect(self,stop))
-                }
-
-            }
-        }
-    }
-
-    // Generates the request enum type, and makes it derive Debug, Serialize and Deserialize
-    fn enum_request(&self) -> TokenStream2 {
-        let &Self {
-            vis,
-            request_ident,
-            camel_case_idents,
-            args,
-            ..
-        } = self;
-
-        quote! {
-            /// The request sent over the wire from the client to the server.
-            #[derive(Debug, serde::Serialize, serde::Deserialize, Clone)]
-            #vis enum #request_ident {
-                #( #camel_case_idents{ #( #args ),* } ),*
-            }
-        }
-    }
-
-    // Generates the response enum type, and makes it derive Debug, Serialize and Deserialize
-    fn enum_response(&self) -> TokenStream2 {
-        let &Self {
-            vis,
-            response_ident,
-            camel_case_idents,
-            return_types,
-            ..
-        } = self;
-
-        quote! {
-            /// The response sent over the wire from the server to the client.
-            #[derive(Debug, serde::Serialize, serde::Deserialize, Clone)]
-            #vis enum #response_ident {
-                #( #camel_case_idents(#return_types) ),*
-            }
-        }
-    }
-
-    // Generates the client struct
-    fn struct_client(&self) -> TokenStream2 {
-        let &Self {
-            vis,
-            client_ident,
-            request_ident,
-            response_ident,
-            ..
-        } = self;
-
-        quote! {
-            #[allow(unused)]
-            #[derive(Clone, Debug)]
-            #vis struct #client_ident<C = zrpc::ZNClientChannel<#request_ident, #response_ident>>{
-                ch : C,
-                server_uuid : Uuid,
-            }
-        }
-    }
-
-    // Generates the implentation of the client
-    fn impl_client_new_find_servers(&self) -> TokenStream2 {
-        let &Self {
-            client_ident,
-            vis,
-            eval_path,
-            ..
-        } = self;
-
-        quote! {
-            impl #client_ident {
-                #vis fn new(
-                    z : async_std::sync::Arc<zenoh::net::Session>,
-                    instance_id : uuid::Uuid
-                ) -> #client_ident {
-                        let new_client = zrpc::ZNClientChannel::new(z, format!("{}",#eval_path), Some(instance_id));
-                        #client_ident{
-                            ch : new_client,
-                            server_uuid : instance_id,
-                        }
-
-                    }
-
-                #vis fn get_server_uuid(&self) -> Uuid {
-                    self.server_uuid
-                }
-
-                #vis fn find_servers(
-                    z : async_std::sync::Arc<zenoh::net::Session>
-                ) -> impl std::future::Future<Output = ZRPCResult<Vec<uuid::Uuid>>> + 'static
-                {
-                    async move {
-                        log::trace!("Find servers selector {}", format!("{}*/state",#eval_path));
-                        let reskey = net::ResKey::RId(
-                                z
-                                .declare_resource(&net::ResKey::RName(format!("{}*/state",#eval_path)))
-                                .await?,
-                                );
-                        let mut servers = Vec::new();
-
-                        let mut replies = z
-                            .query(
-                                &reskey,
-                                "",
-                                net::QueryTarget::default(),
-                                net::QueryConsolidation::default(),
-                            )
-                            .await?;
-
-                        while let Some(d) = replies.next().await {
-                            let buf = d.data.payload;
-                            let ca = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                            servers.push(ca.uuid);
-                        }
-                        Ok(servers)
-                    }
-                }
-
-                #vis fn find_local_servers(
-                    z : async_std::sync::Arc<zenoh::net::Session>
-                ) -> impl std::future::Future<Output = ZRPCResult<Vec<uuid::Uuid>>> + 'static
-                {
-                    async move {
-                        log::trace!("Find servers selector {}", format!("{}*/state",#eval_path));
-                        let reskey = net::ResKey::RId(
-                                z
-                                .declare_resource(&net::ResKey::RName(format!("{}*/state",#eval_path)))
-                                .await?,
-                                );
-                        let mut servers = Vec::new();
-
-                        let mut replies = z
-                            .query(
-                                &reskey,
-                                "",
-                                net::QueryTarget::default(),
-                                net::QueryConsolidation::default(),
-                            )
-                            .await?;
-
-                        while let Some(d) = replies.next().await {
-                            let buf = d.data.payload;
-                            let ca = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                            servers.push(ca);
-                        }
-
-                        let zinfo = z.info().await;
-                        let rid = match zinfo.get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY) {
-                            Some(r_info) => {
-                                if r_info != "" {
-                                    r_info.split(",").collect::<Vec<_>>()[0].to_uppercase()
-                                } else {
-                                    return Err(ZRPCError::NoRouter)
-                                }
-
-                            },
-                            None => return Err(ZRPCError::NoRouter),
-                        };
-                        log::trace!("Router ID is {}", rid);
-
-                        // This is a get from in the Router Admin space
-                        let reskey = net::ResKey::RId(
-                            z
-                            .declare_resource(&net::ResKey::RName(format!("/@/router/{}", rid)))
-                            .await?,
-                            );
-
-                        let rdata : Vec<zenoh::net::Reply> = z.query(
-                            &reskey,
-                            "",
-                            net::QueryTarget::default(),
-                            net::QueryConsolidation::default(),
-                            )
-                            .await?
-                            .collect()
-                            .await;
-
-                        if rdata.len() == 0 {
-                            return Err(ZRPCError::NotFound);
-                        }
-
-                        let router_data = &rdata[0].data;
-
-                        // Getting Zenoh encoding for the reply
-                        let reply_encoding = if let Some(info) = router_data.data_info.clone() {
-                            info.encoding.unwrap_or(zenoh::net::protocol::proto::encoding::APP_OCTET_STREAM)
-                        } else {
-                            zenoh::net::protocol::proto::encoding::APP_OCTET_STREAM
-                        };
-
-                        let router_value = zenoh::Value::decode(reply_encoding, router_data.payload.clone())?;
-
-                        // Checking the value and finding local services
-                        match router_value {
-                            zenoh::Value::Json(sv) => {
-                                let ri = zrpc::serialize::deserialize_router_info(&sv.as_bytes())?;
-                                let r : Vec<Uuid> = servers.into_iter().filter_map(
-                                    |ci| {
-                                        let pid = String::from(&ci.peerid).to_uppercase();
-                                        let mut it = ri.clone().sessions.into_iter();
-                                        let f = it.find(|x| x.peer == pid.clone());
-                                        if f.is_none(){
-                                            None
-                                        } else {
-                                            Some(ci.uuid)
-                                        }
-                                    }
-                                )
-                                .collect();
-                                log::trace!("Local Servers Result {:?}", r);
-                                Ok(r)
-                            }
-                            _ => Err(ZRPCError::ZenohError("Router information is not encoded in JSON".to_string()))
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    // Generates the implementation of the client methods that maps to evals
-    fn impl_client_eval_methods(&self) -> TokenStream2 {
-        let &Self {
-            client_ident,
-            request_ident,
-            response_ident,
-            method_attrs,
-            vis,
-            method_idents,
-            args,
-            return_types,
-            arg_pats,
-            camel_case_idents,
-            timeout,
-            ..
-        } = self;
-
-        quote! {
-
-            impl #client_ident {
-                #vis fn verify_server(&self
-                ) -> impl std::future::Future<Output = ZRPCResult<bool>> + '_ {
-                    async move {
-                        self.ch.verify_server().await
-                    }
-                }
-
-                #(
-
-                    #[allow(unused,clippy::manual_async_fn)]
-                    #( #method_attrs )*
-                    #vis fn #method_idents(&self, #( #args ),*)
-                        -> impl std::future::Future<Output = ZRPCResult<#return_types>> + '_ {
-                        let request = #request_ident::#camel_case_idents { #( #arg_pats ),* };
-                        log::trace!("Sending {:?}", request);
-                        async move {
-                            let resp = self.ch.call_fun(request);
-                            let dur = std::time::Duration::from_secs(#timeout as u64);
-                            match async_std::future::timeout(dur, resp).await {
-                                Ok(r) => match r {
-                                    Ok(zr) => match zr {
-                                            #response_ident::#camel_case_idents(msg) => std::result::Result::Ok(msg),
-                                            _ => Err(ZRPCError::Unreachable),
-                                        },
-                                    Err(e) => Err(e),
-                                },
-                                Err(e) => Err(ZRPCError::TimedOut),
-                            }
-                        }
-                    }
-                )*
-            }
-        }
-    }
-}
-
-//Converts ZNServiceGenerator to actual code
-impl<'a> ToTokens for ZNServiceGenerator<'a> {
-    fn to_tokens(&self, output: &mut TokenStream2) {
-        output.extend(vec![
-            self.trait_service(),
-            self.struct_server(),
-            self.impl_serve_for_server(),
-            self.enum_request(),
-            self.enum_response(),
-            self.struct_client(),
-            self.impl_client_new_find_servers(),
-            self.impl_client_eval_methods(),
-        ])
-    }
-}
-
-//converts to snake_case to CamelCase, is used to convert functions name
-fn snake_to_camel(ident_str: &str) -> String {
-    let mut camel_ty = String::with_capacity(ident_str.len());
-
-    let mut last_char_was_underscore = true;
-    for c in ident_str.chars() {
-        match c {
-            '_' => last_char_was_underscore = true,
-            c if last_char_was_underscore => {
-                camel_ty.extend(c.to_uppercase());
-                last_char_was_underscore = false;
-            }
-            c => camel_ty.extend(c.to_lowercase()),
-        }
-    }
-
-    camel_ty.shrink_to_fit();
-    camel_ty
-}
diff --git a/znrpc-macros/src/receiver.rs b/znrpc-macros/src/receiver.rs
deleted file mode 100644
index 847c72f1..00000000
--- a/znrpc-macros/src/receiver.rs
+++ /dev/null
@@ -1,348 +0,0 @@
-/*********************************************************************************
-* Copyright (c) 2020 David Tolnay, async-trait
-*
-* This program and the accompanying materials are made available under the
-* terms of the Apache Software License 2.0
-* which is available at https://www.apache.org/licenses/LICENSE-2.0.
-*
-* SPDX-License-Identifier: Apache-2.0
-* Contributors:
-*   David Tolnay, <dtolnay@gmail.com>
-*********************************************************************************/
-
-use proc_macro2::{Group, Spacing, Span, TokenStream, TokenTree};
-use quote::{quote, quote_spanned, ToTokens};
-use std::iter::FromIterator;
-use std::mem;
-use syn::punctuated::Punctuated;
-use syn::visit_mut::{self, VisitMut};
-use syn::{
-    parse::Parse, parse_quote, /*Block,*/ Error, ExprPath, ExprStruct, Ident, Item, Macro,
-    PatPath, PatStruct, PatTupleStruct, Path, PathArguments, QSelf, Receiver,
-    /*Signature,*/ Token, Type, TypePath, /*WherePredicate,*/
-};
-
-// pub fn has_self_in_sig(sig: &mut Signature) -> bool {
-//     let mut visitor = HasSelf(false);
-//     visitor.visit_signature_mut(sig);
-//     visitor.0
-// }
-
-// pub fn has_self_in_where_predicate(where_predicate: &mut WherePredicate) -> bool {
-//     let mut visitor = HasSelf(false);
-//     visitor.visit_where_predicate_mut(where_predicate);
-//     visitor.0
-// }
-
-// pub fn has_self_in_block(block: &mut Block) -> bool {
-//     let mut visitor = HasSelf(false);
-//     visitor.visit_block_mut(block);
-//     visitor.0
-// }
-
-fn has_self_in_token_stream(tokens: TokenStream) -> bool {
-    tokens.into_iter().any(|tt| match tt {
-        TokenTree::Ident(ident) => ident == "Self",
-        TokenTree::Group(group) => has_self_in_token_stream(group.stream()),
-        _ => false,
-    })
-}
-
-struct HasSelf(bool);
-
-impl VisitMut for HasSelf {
-    fn visit_expr_path_mut(&mut self, expr: &mut ExprPath) {
-        self.0 |= expr.path.segments[0].ident == "Self";
-        visit_mut::visit_expr_path_mut(self, expr);
-    }
-
-    fn visit_pat_path_mut(&mut self, pat: &mut PatPath) {
-        self.0 |= pat.path.segments[0].ident == "Self";
-        visit_mut::visit_pat_path_mut(self, pat);
-    }
-
-    fn visit_type_path_mut(&mut self, ty: &mut TypePath) {
-        self.0 |= ty.path.segments[0].ident == "Self";
-        visit_mut::visit_type_path_mut(self, ty);
-    }
-
-    fn visit_receiver_mut(&mut self, _arg: &mut Receiver) {
-        self.0 = true;
-    }
-
-    fn visit_item_mut(&mut self, _: &mut Item) {
-        // Do not recurse into nested items.
-    }
-
-    fn visit_macro_mut(&mut self, mac: &mut Macro) {
-        if !contains_fn(mac.tokens.clone()) {
-            self.0 |= has_self_in_token_stream(mac.tokens.clone());
-        }
-    }
-}
-
-pub struct ReplaceReceiver {
-    pub with: Type,
-    pub as_trait: Option<Path>,
-}
-
-impl ReplaceReceiver {
-    // pub fn with(ty: Type) -> Self {
-    //     ReplaceReceiver {
-    //         with: ty,
-    //         as_trait: None,
-    //     }
-    // }
-
-    pub fn with_as_trait(ty: Type, as_trait: Option<Path>) -> Self {
-        ReplaceReceiver { with: ty, as_trait }
-    }
-
-    fn self_ty(&self, span: Span) -> Type {
-        respan(&self.with, span)
-    }
-
-    fn self_to_qself_type(&self, qself: &mut Option<QSelf>, path: &mut Path) {
-        let include_as_trait = true;
-        self.self_to_qself(qself, path, include_as_trait);
-    }
-
-    fn self_to_qself_expr(&self, qself: &mut Option<QSelf>, path: &mut Path) {
-        let include_as_trait = false;
-        self.self_to_qself(qself, path, include_as_trait);
-    }
-
-    fn self_to_qself(&self, qself: &mut Option<QSelf>, path: &mut Path, include_as_trait: bool) {
-        if path.leading_colon.is_some() {
-            return;
-        }
-
-        let first = &path.segments[0];
-        if first.ident != "Self" || !first.arguments.is_empty() {
-            return;
-        }
-
-        if path.segments.len() == 1 {
-            self.self_to_expr_path(path);
-            return;
-        }
-
-        let span = first.ident.span();
-        *qself = Some(QSelf {
-            lt_token: Token![<](span),
-            ty: Box::new(self.self_ty(span)),
-            position: 0,
-            as_token: None,
-            gt_token: Token![>](span),
-        });
-
-        if include_as_trait && self.as_trait.is_some() {
-            let as_trait = self.as_trait.as_ref().unwrap().clone();
-            path.leading_colon = as_trait.leading_colon;
-            qself.as_mut().unwrap().position = as_trait.segments.len();
-
-            let segments = mem::replace(&mut path.segments, as_trait.segments);
-            path.segments.push_punct(Default::default());
-            path.segments.extend(segments.into_pairs().skip(1));
-        } else {
-            path.leading_colon = Some(**path.segments.pairs().next().unwrap().punct().unwrap());
-
-            let segments = mem::replace(&mut path.segments, Punctuated::new());
-            path.segments = segments.into_pairs().skip(1).collect();
-        }
-    }
-
-    fn self_to_expr_path(&self, path: &mut Path) {
-        if path.leading_colon.is_some() {
-            return;
-        }
-
-        let first = &path.segments[0];
-        if first.ident != "Self" || !first.arguments.is_empty() {
-            return;
-        }
-
-        if let Type::Path(self_ty) = self.self_ty(first.ident.span()) {
-            let variant = mem::replace(path, self_ty.path);
-            for segment in &mut path.segments {
-                if let PathArguments::AngleBracketed(bracketed) = &mut segment.arguments {
-                    if bracketed.colon2_token.is_none() && !bracketed.args.is_empty() {
-                        bracketed.colon2_token = Some(Default::default());
-                    }
-                }
-            }
-            if variant.segments.len() > 1 {
-                path.segments.push_punct(Default::default());
-                path.segments.extend(variant.segments.into_pairs().skip(1));
-            }
-        } else {
-            let span = path.segments[0].ident.span();
-            let msg = "Self type of this impl is unsupported in expression position";
-            let error = Error::new(span, msg).to_compile_error();
-            *path = parse_quote!(::core::marker::PhantomData::<#error>);
-        }
-    }
-
-    fn visit_token_stream(&self, tokens: &mut TokenStream) -> bool {
-        let mut out = Vec::new();
-        let mut modified = false;
-        let mut iter = tokens.clone().into_iter().peekable();
-        while let Some(tt) = iter.next() {
-            match tt {
-                TokenTree::Ident(mut ident) => {
-                    modified |= prepend_underscore_to_self(&mut ident);
-                    if ident == "Self" {
-                        modified = true;
-                        if self.as_trait.is_none() {
-                            let ident = Ident::new("AsyncTrait", ident.span());
-                            out.push(TokenTree::Ident(ident));
-                        } else {
-                            let self_ty = self.self_ty(ident.span());
-                            match iter.peek() {
-                                Some(TokenTree::Punct(p))
-                                    if p.as_char() == ':' && p.spacing() == Spacing::Joint =>
-                                {
-                                    let next = iter.next().unwrap();
-                                    match iter.peek() {
-                                        Some(TokenTree::Punct(p)) if p.as_char() == ':' => {
-                                            let span = ident.span();
-                                            out.extend(quote_spanned!(span=> <#self_ty>));
-                                        }
-                                        _ => out.extend(quote!(#self_ty)),
-                                    }
-                                    out.push(next);
-                                }
-                                _ => out.extend(quote!(#self_ty)),
-                            }
-                        }
-                    } else {
-                        out.push(TokenTree::Ident(ident));
-                    }
-                }
-                TokenTree::Group(group) => {
-                    let mut content = group.stream();
-                    modified |= self.visit_token_stream(&mut content);
-                    let mut new = Group::new(group.delimiter(), content);
-                    new.set_span(group.span());
-                    out.push(TokenTree::Group(new));
-                }
-                other => out.push(other),
-            }
-        }
-        if modified {
-            *tokens = TokenStream::from_iter(out);
-        }
-        modified
-    }
-}
-
-impl VisitMut for ReplaceReceiver {
-    // `Self` -> `Receiver`
-    fn visit_type_mut(&mut self, ty: &mut Type) {
-        if let Type::Path(node) = ty {
-            if node.qself.is_none() && node.path.is_ident("Self") {
-                *ty = self.self_ty(node.path.segments[0].ident.span());
-            } else {
-                self.visit_type_path_mut(node);
-            }
-        } else {
-            visit_mut::visit_type_mut(self, ty);
-        }
-    }
-
-    // `Self::Assoc` -> `<Receiver>::Assoc`
-    fn visit_type_path_mut(&mut self, ty: &mut TypePath) {
-        if ty.qself.is_none() {
-            self.self_to_qself_type(&mut ty.qself, &mut ty.path);
-        }
-        visit_mut::visit_type_path_mut(self, ty);
-    }
-
-    // `Self::method` -> `<Receiver>::method`
-    fn visit_expr_path_mut(&mut self, expr: &mut ExprPath) {
-        if expr.qself.is_none() {
-            prepend_underscore_to_self(&mut expr.path.segments[0].ident);
-            self.self_to_qself_expr(&mut expr.qself, &mut expr.path);
-        }
-        visit_mut::visit_expr_path_mut(self, expr);
-    }
-
-    fn visit_expr_struct_mut(&mut self, expr: &mut ExprStruct) {
-        self.self_to_expr_path(&mut expr.path);
-        visit_mut::visit_expr_struct_mut(self, expr);
-    }
-
-    fn visit_pat_path_mut(&mut self, pat: &mut PatPath) {
-        if pat.qself.is_none() {
-            self.self_to_qself_expr(&mut pat.qself, &mut pat.path);
-        }
-        visit_mut::visit_pat_path_mut(self, pat);
-    }
-
-    fn visit_pat_struct_mut(&mut self, pat: &mut PatStruct) {
-        self.self_to_expr_path(&mut pat.path);
-        visit_mut::visit_pat_struct_mut(self, pat);
-    }
-
-    fn visit_pat_tuple_struct_mut(&mut self, pat: &mut PatTupleStruct) {
-        self.self_to_expr_path(&mut pat.path);
-        visit_mut::visit_pat_tuple_struct_mut(self, pat);
-    }
-
-    fn visit_item_mut(&mut self, i: &mut Item) {
-        match i {
-            // Visit `macro_rules!` because locally defined macros can refer to `self`.
-            Item::Macro(i) if i.mac.path.is_ident("macro_rules") => {
-                self.visit_macro_mut(&mut i.mac)
-            }
-            // Otherwise, do not recurse into nested items.
-            _ => {}
-        }
-    }
-
-    fn visit_macro_mut(&mut self, mac: &mut Macro) {
-        // We can't tell in general whether `self` inside a macro invocation
-        // refers to the self in the argument list or a different self
-        // introduced within the macro. Heuristic: if the macro input contains
-        // `fn`, then `self` is more likely to refer to something other than the
-        // outer function's self argument.
-        if !contains_fn(mac.tokens.clone()) {
-            self.visit_token_stream(&mut mac.tokens);
-        }
-    }
-}
-
-fn contains_fn(tokens: TokenStream) -> bool {
-    tokens.into_iter().any(|tt| match tt {
-        TokenTree::Ident(ident) => ident == "fn",
-        TokenTree::Group(group) => contains_fn(group.stream()),
-        _ => false,
-    })
-}
-
-fn prepend_underscore_to_self(ident: &mut Ident) -> bool {
-    let modified = ident == "self";
-    if modified {
-        *ident = Ident::new("_self", ident.span());
-    }
-    modified
-}
-
-pub(crate) fn respan<T>(node: &T, span: Span) -> T
-where
-    T: ToTokens + Parse,
-{
-    let tokens = node.to_token_stream();
-    let respanned = respan_tokens(tokens, span);
-    syn::parse2(respanned).unwrap()
-}
-
-fn respan_tokens(tokens: TokenStream, span: Span) -> TokenStream {
-    tokens
-        .into_iter()
-        .map(|mut token| {
-            token.set_span(span);
-            token
-        })
-        .collect()
-}
diff --git a/zrpc-macros/Cargo.toml b/zrpc-macros/Cargo.toml
deleted file mode 100644
index b375244e..00000000
--- a/zrpc-macros/Cargo.toml
+++ /dev/null
@@ -1,46 +0,0 @@
-[package]
-name = "zrpc-macros"
-version = "0.3.0-alpha1"
-repository = "https://github.com/eclipse-fog05/fog05"
-homepage = "http://fog05.io"
-authors = ["gabrik <gabriele.baldoni@gmail.com>"]
-edition = "2018"
-license = " EPL-2.0 OR Apache-2.0"
-description = "fog05: The End-to-End Compute, Storage and Networking Virtualisation solution."
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-# To build with debug on macros: RUSTFLAGS="-Z macro-backtrace"
-
-[dependencies]
-async-std = { version = "=1.9.0", features = ["attributes"] }
-futures = "0.3.5"
-syn = { version = "1.0.11", features = ["full"] }
-quote = "1.0.2"
-proc-macro2 = "1.0.6"
-serde_derive = "1.0.55"
-serde = { version = "1.0.55", features = ["derive"] }
-zenoh = { git = "https://github.com/eclipse-zenoh/zenoh.git", rev = "cf124d6c4d393e65662d1e1caf567b66af7150d5" }
-zrpc = {path = "../zrpc"}
-base64 = "0.13.0"
-log = "0.4.11"
-uuid = { version = "0.8.1", features = ["serde", "v4"] }
-darling = "0.12.0"
-Inflector = "0.11.4"
-bincode = { version = "1.3.1"}
-
-
-
-[dev-dependencies]
-bincode = { version = "1.3.1"}
-serde_json = { version = "1.0.55"}
-base64 = "0.13.0"
-env_logger = "0.8.3"
-
-[lib]
-proc-macro = true
-
-[[example]]
-name = "zworking"
-
-[[example]]
-name = "zservice"
diff --git a/zrpc-macros/examples/zservice.rs b/zrpc-macros/examples/zservice.rs
deleted file mode 100644
index 8a64e5b0..00000000
--- a/zrpc-macros/examples/zservice.rs
+++ /dev/null
@@ -1,117 +0,0 @@
-#![allow(clippy::manual_async_fn)]
-#![allow(clippy::large_enum_variant)]
-
-#[macro_use]
-extern crate std;
-
-use async_std::prelude::FutureExt;
-use async_std::sync::{Arc, Mutex};
-use async_std::task;
-use futures::prelude::*;
-use std::convert::TryFrom;
-use std::str;
-use std::time::Duration;
-use uuid::Uuid;
-use zenoh::*;
-use zrpc::ZServe;
-//importing the macros
-use zrpc::zrpcresult::{ZRPCError, ZRPCResult};
-use zrpc_macros::{zserver, zservice};
-
-#[zservice(timeout_s = 60, prefix = "/lfos")]
-pub trait Hello {
-    async fn hello(&self, name: String) -> String;
-    async fn add(&mut self) -> u64;
-}
-
-#[derive(Clone)]
-struct HelloZService {
-    pub ser_name: String,
-    pub counter: Arc<Mutex<u64>>,
-}
-
-#[zserver]
-impl Hello for HelloZService {
-    async fn hello(&self, name: String) -> String {
-        format!("Hello {}!, you are connected to {}", name, self.ser_name)
-    }
-
-    async fn add(&mut self) -> u64 {
-        let mut guard = self.counter.lock().await;
-        *guard += 1;
-        *guard
-    }
-}
-
-#[async_std::main]
-async fn main() {
-    let zenoh = Arc::new(
-        Zenoh::new(Properties::from("mode=client;peer=tcp/127.0.0.1:7447").into())
-            .await
-            .unwrap(),
-    );
-    // let ws = Arc::new(zenoh.workspace(None).await.unwrap());
-
-    let service = HelloZService {
-        ser_name: "test service".to_string(),
-        counter: Arc::new(Mutex::new(0u64)),
-    };
-
-    let z = zenoh.clone();
-
-    let server = service.get_hello_server(z, None);
-    let ser_uuid = server.instance_uuid();
-    let client = HelloClient::new(zenoh.clone(), ser_uuid);
-
-    server.connect().await.unwrap();
-    server.initialize().await.unwrap();
-    server.register().await.unwrap();
-
-    let local_servers = HelloClient::find_local_servers(zenoh.clone()).await;
-    println!("local_servers: {:?}", local_servers);
-
-    let servers = HelloClient::find_servers(zenoh.clone()).await;
-    println!("servers found: {:?}", servers);
-
-    // this should return an error as the server is not ready
-    let hello = client.hello("client".to_string()).await;
-    println!("Res is: {:?}", hello);
-
-    let (s, handle) = server.start().await.unwrap();
-
-    let local_servers = HelloClient::find_local_servers(zenoh.clone()).await;
-    println!("local_servers: {:?}", local_servers);
-
-    let servers = HelloClient::find_servers(zenoh.clone()).await;
-    println!("servers found: {:?}", servers);
-
-    task::sleep(Duration::from_secs(1)).await;
-    let hello = client.hello("client".to_string()).await;
-    println!("Res is: {:?}", hello);
-
-    let hello = client.add().await;
-    println!("Res is: {:?}", hello);
-
-    let hello = client.add().await;
-    println!("Res is: {:?}", hello);
-
-    let hello = client.add().await;
-    println!("Res is: {:?}", hello);
-
-    server.stop(s).await.unwrap();
-
-    let local_servers = HelloClient::find_local_servers(zenoh.clone()).await;
-    println!("local_servers: {:?}", local_servers);
-
-    let servers = HelloClient::find_servers(zenoh.clone()).await;
-    println!("servers found: {:?}", servers);
-
-    server.unregister().await.unwrap();
-    server.disconnect().await.unwrap();
-
-    handle.await.unwrap();
-
-    // this should return an error as the server is not there
-    let hello = client.hello("client".to_string()).await;
-    println!("Res is: {:?}", hello);
-}
diff --git a/zrpc-macros/examples/zworking.rs b/zrpc-macros/examples/zworking.rs
deleted file mode 100644
index 8be581df..00000000
--- a/zrpc-macros/examples/zworking.rs
+++ /dev/null
@@ -1,773 +0,0 @@
-#![allow(clippy::manual_async_fn)]
-#![allow(clippy::large_enum_variant)]
-#![feature(libstd_sys_internals)]
-#![feature(print_internals)]
-#![feature(fmt_internals)]
-#![feature(prelude_import)]
-#![feature(async_closure)]
-#![feature(associated_type_bounds)]
-#[prelude_import]
-#[macro_use]
-extern crate std;
-extern crate base64;
-extern crate serde;
-extern crate serde_json;
-
-use async_std::prelude::FutureExt;
-use async_std::sync::{Arc, Mutex};
-use async_std::task;
-use futures::prelude::*;
-use serde::{Deserialize, Serialize};
-use std::convert::TryFrom;
-use std::str;
-use std::time::Duration;
-use uuid::Uuid;
-use zenoh::*;
-use zrpc::zrpcresult::{ZRPCError, ZRPCResult};
-use zrpc::ZServe;
-
-pub trait Hello: Clone {
-    fn hello(&self, name: String) -> String;
-    fn get_hello_server(self, z: Arc<zenoh::Zenoh>) -> ServeHello<Self> {
-        ServeHello::new(z, self)
-    }
-    fn add(&mut self) -> u64;
-}
-
-#[derive(Clone)]
-pub struct ServeHello<S> {
-    z: Arc<zenoh::Zenoh>,
-    server: S,
-    instance_id: Uuid,
-}
-
-impl<S> ServeHello<S> {
-    pub fn new(z: Arc<zenoh::Zenoh>, server: S) -> Self {
-        Self {
-            z,
-            server,
-            instance_id: Uuid::new_v4(),
-        }
-    }
-}
-
-impl<S> zrpc::ZServe<HelloRequest> for ServeHello<S>
-where
-    S: Hello + Send + 'static,
-{
-    type Resp = HelloResponse;
-
-    fn instance_uuid(&self) -> uuid::Uuid {
-        self.instance_id
-    }
-
-    fn connect(
-        &'_ self,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-        log::trace!("server connect");
-        async fn __connect<S>(_self: &ServeHello<S>) -> ZRPCResult<()>
-        where
-            S: Hello + Send + 'static,
-        {
-            let zsession = _self.z.session();
-            let zinfo = zsession.info().await;
-            let pid = zinfo
-                .get(&zenoh::net::info::ZN_INFO_PID_KEY)
-                .ok_or(ZRPCError::MissingValue)?
-                .to_uppercase();
-            let rid = zinfo
-                .get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY)
-                .ok_or(ZRPCError::MissingValue)?
-                .split(',')
-                .collect::<Vec<_>>()[0]
-                .to_uppercase();
-            let ws = _self.z.workspace(None).await?;
-
-            let component_info = zrpc::ComponentState {
-                uuid: _self.instance_uuid(),
-                name: "Hello".to_string(),
-                routerid: rid.clone().to_uppercase(),
-                peerid: pid.clone().to_uppercase(),
-                status: zrpc::ComponentStatus::HALTED,
-            };
-            let encoded_ci = zrpc::serialize::serialize_state(&component_info)?;
-            let path = zenoh::Path::try_from(format!(
-                "/zservice/Hello/00000000-0000-0000-0000-000000000001/{}/state",
-                _self.instance_uuid()
-            ))?;
-            Ok(ws.put(&path, encoded_ci.into()).await?)
-        }
-        Box::pin(__connect(self))
-    }
-
-    fn initialize(
-        &self,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-        log::trace!("server initialize");
-        async fn __initialize<S>(_self: &ServeHello<S>) -> ZRPCResult<()>
-        where
-            S: Hello + Send + 'static,
-        {
-            let selector = zenoh::Selector::try_from(format!(
-                "/zservice/Hello/00000000-0000-0000-0000-000000000001/{}/state",
-                _self.instance_uuid()
-            ))?;
-            let ws = _self.z.workspace(None).await?;
-            let ds = ws.get(&selector).await?;
-            let data: Vec<zenoh::Data> = ds.collect().await;
-            match data.len() {
-                0 => Err(ZRPCError::NotFound),
-                1 => {
-                    let kv = &data[0];
-                    match &kv.value {
-                        zenoh::Value::Raw(_, buf) => {
-                            let mut ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(
-                                &buf.to_vec(),
-                            )?;
-                            match ci.status {
-                                    zrpc::ComponentStatus::HALTED => {
-                                        ci.status = zrpc::ComponentStatus::INITIALIZING;
-                                        let encoded_ci = zrpc::serialize::serialize_state(&ci)?;
-                                        let path = zenoh::Path::try_from(format!("/zservice/Hello/00000000-0000-0000-0000-000000000001/{}/state",
-                                        _self.instance_uuid()))?;
-                                        Ok(ws.put(&path,encoded_ci.into()).await?)
-                                    },
-                                    _ => Err(ZRPCError::StateTransitionNotAllowed("Cannot authenticate a component in a state different than HALTED".to_string())),
-                                }
-                        }
-                        _ => Err(ZRPCError::ZenohError(
-                            "Component state is expected to be RAW in Zenoh!!".to_string(),
-                        )),
-                    }
-                }
-                _ => Err(ZRPCError::Unreachable),
-            }
-        }
-        Box::pin(__initialize(self))
-    }
-
-    fn register(
-        &self,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-        log::trace!("server register");
-        async fn __register<S>(_self: &ServeHello<S>) -> ZRPCResult<()>
-        where
-            S: Hello + Send + 'static,
-        {
-            let selector = zenoh::Selector::try_from(format!(
-                "/zservice/Hello/00000000-0000-0000-0000-000000000001/{}/state",
-                _self.instance_uuid()
-            ))?;
-            let ws = _self.z.workspace(None).await?;
-            let ds = ws.get(&selector).await?;
-            let data: Vec<zenoh::Data> = ds.collect().await;
-            match data.len() {
-                0 => Err(ZRPCError::NotFound),
-                1 => {
-                    let kv = &data[0];
-                    match &kv.value {
-                        zenoh::Value::Raw(_, buf) => {
-                            let mut ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(
-                                &buf.to_vec(),
-                            )?;
-                            match ci.status {
-                                    zrpc::ComponentStatus::INITIALIZING => {
-                                        ci.status = zrpc::ComponentStatus::REGISTERED;
-                                        let encoded_ci = zrpc::serialize::serialize_state(&ci)?;
-                                        let path = zenoh::Path::try_from(format!("/zservice/Hello/00000000-0000-0000-0000-000000000001/{}/state",
-                                        _self.instance_uuid()))?;
-                                        Ok(ws.put(&path,encoded_ci.into()).await?)
-                                    },
-                                    _ => Err(ZRPCError::StateTransitionNotAllowed("Cannot authenticate a component in a state different than BUILDING".to_string())),
-                                }
-                        }
-                        _ => Err(ZRPCError::ZenohError(
-                            "Component state is expected to be RAW in Zenoh!!".to_string(),
-                        )),
-                    }
-                }
-                _ => Err(ZRPCError::Unreachable),
-            }
-        }
-        Box::pin(__register(self))
-    }
-
-    fn start(
-        &self,
-    ) -> ::core::pin::Pin<
-        Box<
-            dyn std::future::Future<
-                    Output = ZRPCResult<(
-                        async_std::channel::Sender<()>,
-                        async_std::task::JoinHandle<ZRPCResult<()>>,
-                    )>,
-                > + '_,
-        >,
-    > {
-        log::trace!("server start");
-        async fn __start<S>(
-            _self: &ServeHello<S>,
-        ) -> ZRPCResult<(
-            async_std::channel::Sender<()>,
-            async_std::task::JoinHandle<ZRPCResult<()>>,
-        )>
-        where
-            S: Hello + Send + 'static,
-        {
-            let (s, r) = async_std::channel::bounded::<()>(1);
-            let selector = zenoh::Selector::try_from(format!(
-                "/zservice/Hello/00000000-0000-0000-0000-000000000001/{}/state",
-                _self.instance_uuid()
-            ))?;
-            let ws = _self.z.workspace(None).await?;
-            let ds = ws.get(&selector).await?;
-            let data: Vec<zenoh::Data> = ds.collect().await;
-            match data.len() {
-                0 => Err(ZRPCError::NotFound),
-                1 => {
-                    let kv = &data[0];
-                    match &kv.value {
-                        zenoh::Value::Raw(_, buf) => {
-                            let mut ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(
-                                &buf.to_vec(),
-                            )?;
-                            match ci.status {
-                                zrpc::ComponentStatus::REGISTERED => {
-                                    ci.status = zrpc::ComponentStatus::SERVING;
-                                    let encoded_ci = zrpc::serialize::serialize_state(&ci)?;
-                                    let path = zenoh::Path::try_from(format!(
-                                        "/zservice/Hello/00000000-0000-0000-0000-000000000001/{}/state",
-                                        _self.instance_uuid()
-                                    ))?;
-                                    ws.put(&path, encoded_ci.into()).await?;
-                                    let server = _self.clone();
-                                    let h = async_std::task::spawn_blocking(move || {
-                                        async_std::task::block_on(async {
-                                            server.serve(r).await
-                                        })
-                                    });
-                                    Ok((s, h))
-                                }
-                                _ =>
-                                Err(ZRPCError::StateTransitionNotAllowed("Cannot authenticate a component in a state different than REGISTERED".to_string())),
-                            }
-                        }
-                        _ => Err(ZRPCError::ZenohError(
-                            "Component state is expected to be RAW in Zenoh!!".to_string(),
-                        )),
-                    }
-                }
-                _ => Err(ZRPCError::Unreachable),
-            }
-        }
-        Box::pin(__start(self))
-    }
-
-    fn serve(
-        &self,
-        stop: async_std::channel::Receiver<()>,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-        log::trace!("server serve");
-        async fn __serve<S>(
-            _self: &ServeHello<S>,
-            _stop: async_std::channel::Receiver<()>,
-        ) -> ZRPCResult<()>
-        where
-            S: Hello + Send + 'static,
-        {
-            let selector = zenoh::Selector::try_from(format!(
-                "/zservice/Hello/00000000-0000-0000-0000-000000000001/{}/state",
-                _self.instance_uuid()
-            ))?;
-            let ws = _self.z.workspace(None).await?;
-            let ds = ws.get(&selector).await?;
-            let data: Vec<zenoh::Data> = ds.collect().await;
-            match data.len() {
-                0 => Err(ZRPCError::NotFound),
-                1 => {
-                    let kv = &data[0];
-                    match &kv.value {
-                        zenoh::Value::Raw(_, buf) => {
-                            let ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(
-                                &buf.to_vec(),
-                            )?;
-                            match ci.status {
-                                zrpc::ComponentStatus::SERVING => {
-                                    let path = zenoh::Path::try_from(format!(
-                                        "/zservice/Hello/00000000-0000-0000-0000-000000000001/{}/eval",
-                                        _self.instance_uuid()
-                                    ))?;
-                                    log::trace!("eval registering");
-                                    let mut rcv = ws.register_eval(&path.clone().into()).await?;
-                                    log::trace!("eval registered");
-
-                                    let rcv_loop = async {
-                                        loop {
-                                            let get_request = rcv
-                                                .next()
-                                                .await
-                                                .ok_or_else(|| async_std::channel::RecvError)?;
-                                            let base64_req = get_request
-                                                .selector
-                                                .properties
-                                                .get("req")
-                                                .cloned()
-                                                .ok_or_else(|| async_std::channel::RecvError)?;
-                                            let b64_bytes = base64::decode(base64_req)
-                                                .map_err(|_| async_std::channel::RecvError)?;
-                                            let req = zrpc::serialize::deserialize_request::<
-                                                HelloRequest,
-                                            >(
-                                                &b64_bytes
-                                            )
-                                            .map_err(|_| async_std::channel::RecvError)?;
-
-                                            let gr = get_request.clone();
-                                            // let inner_ser = arc_ser.clone();
-                                            let mut ser = _self.server.clone();
-                                            let p = path.clone();
-
-                                            match req {
-                                                HelloRequest::Hello { name } => {
-                                                    let resp =
-                                                        HelloResponse::Hello(ser.hello(name));
-                                                    let encoded =
-                                                        zrpc::serialize::serialize_response(&resp)
-                                                            .map_err(|_| {
-                                                                async_std::channel::RecvError
-                                                            })?;
-                                                    gr.reply(p, encoded.into()).await;
-                                                }
-                                                HelloRequest::Add => {
-                                                    let resp = HelloResponse::Add(ser.add());
-                                                    let encoded =
-                                                        zrpc::serialize::serialize_response(&resp)
-                                                            .map_err(|_| {
-                                                                async_std::channel::RecvError
-                                                            })?;
-                                                    gr.reply(p, encoded.into()).await;
-                                                }
-                                            }
-                                        }
-                                    };
-                                    Ok(rcv_loop
-                                        .race(_stop.recv())
-                                        .await
-                                        .map_err(|e| ZRPCError::Error(format!("{}", e)))?)
-                                }
-                                _ => Err(ZRPCError::StateTransitionNotAllowed(
-                                    "State is not WORK, serve called directly?".to_string(),
-                                )),
-                            }
-                        }
-                        _ => Err(ZRPCError::ZenohError(
-                            "Component state is expected to be RAW in Zenoh!!".to_string(),
-                        )),
-                    }
-                }
-                _ => Err(ZRPCError::Unreachable),
-            }
-        }
-        Box::pin(__serve(self, stop))
-    }
-
-    fn stop(
-        &self,
-        stop: async_std::channel::Sender<()>,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-        log::trace!("server stop");
-        async fn __stop<S>(
-            _self: &ServeHello<S>,
-            _stop: async_std::channel::Sender<()>,
-        ) -> ZRPCResult<()>
-        where
-            S: Hello + Send + 'static,
-        {
-            let selector = zenoh::Selector::try_from(format!(
-                "/zservice/Hello/00000000-0000-0000-0000-000000000001/{}/state",
-                _self.instance_uuid()
-            ))?;
-            let ws = _self.z.workspace(None).await?;
-            let ds = ws.get(&selector).await?;
-            let data: Vec<zenoh::Data> = ds.collect().await;
-            match data.len() {
-                0 => Err(ZRPCError::NotFound),
-                1 => {
-                    let kv = &data[0];
-                    match &kv.value {
-                        zenoh::Value::Raw(_, buf) => {
-                            let mut ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(
-                                &buf.to_vec(),
-                            )?;
-                            match ci.status {
-                                zrpc::ComponentStatus::SERVING => {
-                                    ci.status = zrpc::ComponentStatus::REGISTERED;
-                                    let encoded_ci = zrpc::serialize::serialize_state(&ci)?;
-                                    let path = zenoh::Path::try_from(format!(
-                                        "/zservice/Hello/00000000-0000-0000-0000-000000000001/{}/state",
-                                        _self.instance_uuid()
-                                    ))?;
-                                    ws.put(&path, encoded_ci.into()).await?;
-                                    // Here we stop the serve
-                                    Ok(_stop.send(()).await?)
-                                }
-                                _ => Err(ZRPCError::StateTransitionNotAllowed(
-                                    "Cannot unwork a component in a state different than WORK"
-                                        .to_string(),
-                                )),
-                            }
-                        }
-                        _ => Err(ZRPCError::ZenohError(
-                            "Component state is expected to be RAW in Zenoh!!".to_string(),
-                        )),
-                    }
-                }
-                _ => Err(ZRPCError::Unreachable),
-            }
-        }
-        Box::pin(__stop(self, stop))
-    }
-
-    fn unregister(
-        &self,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-        log::trace!("server unregister");
-        async fn __unregister<S>(_self: &ServeHello<S>) -> ZRPCResult<()>
-        where
-            S: Hello + Send + 'static,
-        {
-            let selector = zenoh::Selector::try_from(format!(
-                "/zservice/Hello/00000000-0000-0000-0000-000000000001/{}/state",
-                _self.instance_uuid()
-            ))?;
-            let ws = _self.z.workspace(None).await?;
-            let ds = ws.get(&selector).await?;
-            let data: Vec<zenoh::Data> = ds.collect().await;
-            match data.len() {
-                0 => Err(ZRPCError::NotFound),
-                1 => {
-                    let kv = &data[0];
-                    match &kv.value {
-                        zenoh::Value::Raw(_, buf) => {
-                            let mut ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(
-                                &buf.to_vec(),
-                            )?;
-                            match ci.status {
-                                    zrpc::ComponentStatus::REGISTERED => {
-                                        ci.status = zrpc::ComponentStatus::HALTED;
-                                        let encoded_ci = zrpc::serialize::serialize_state(&ci)?;
-                                        let path = zenoh::Path::try_from(format!(
-                                            "/zservice/Hello/00000000-0000-0000-0000-000000000001/{}/state",
-                                            _self.instance_uuid()))?;
-                                        Ok(ws.put(&path,encoded_ci.into()).await?)
-                                        // Here we should stop the serve
-                                    },
-                                    _ => Err(ZRPCError::StateTransitionNotAllowed("Cannot unregister a component in a state different than UNANNOUNCED".to_string())),
-                                }
-                        }
-                        _ => Err(ZRPCError::ZenohError(
-                            "Component state is expected to be RAW in Zenoh!!".to_string(),
-                        )),
-                    }
-                }
-                _ => Err(ZRPCError::Unreachable),
-            }
-        }
-        Box::pin(__unregister(self))
-    }
-
-    fn disconnect(self) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>>>> {
-        async fn __disconnect<S>(_self: ServeHello<S>) -> ZRPCResult<()>
-        where
-            S: Hello + Send + 'static,
-        {
-            let ws = _self.z.workspace(None).await?;
-            let path = zenoh::Path::try_from(format!(
-                "/zservice/Hello/00000000-0000-0000-0000-000000000001/{}/state",
-                _self.instance_uuid()
-            ))?;
-            Ok(ws.delete(&path).await?)
-        }
-
-        Box::pin(__disconnect(self))
-    }
-}
-
-/// The request sent over the wire from the client to the server.
-#[derive(Debug, Serialize, Deserialize)]
-pub enum HelloRequest {
-    Hello { name: String },
-    Add,
-}
-
-/// The response sent over the wire from the server to the client.
-#[derive(Debug, Serialize, Deserialize)]
-pub enum HelloResponse {
-    Hello(String),
-    Add(u64),
-}
-
-#[derive(Clone)]
-struct HelloZService {
-    pub ser_name: String,
-    pub counter: Arc<Mutex<u64>>,
-}
-
-impl Hello for HelloZService {
-    fn hello(&self, name: String) -> String {
-        task::block_on(async move {
-            let res = format!("Hello {}!, you are connected to {}", name, self.ser_name);
-            res
-        })
-    }
-
-    fn add(&mut self) -> u64 {
-        task::block_on(async move {
-            let mut guard = self.counter.lock().await;
-            *guard += 1;
-            *guard
-        })
-    }
-}
-
-#[allow(unused)]
-/// The client stub that makes RPC calls to the server. Exposes a Future interface.
-#[derive(Clone, Debug)]
-pub struct HelloClient<C = zrpc::ZClientChannel<HelloRequest, HelloResponse>> {
-    ch: C,
-    server_uuid: Uuid,
-    // phantom : PhantomData<&'a ()>
-}
-
-impl HelloClient {
-    pub fn new(z: Arc<zenoh::Zenoh>, instance_id: Uuid) -> HelloClient {
-        let new_client = zrpc::ZClientChannel::new(
-            z,
-            "/zservice/Hello/00000000-0000-0000-0000-000000000001".to_string(),
-            Some(instance_id),
-        );
-        HelloClient {
-            ch: new_client,
-            server_uuid: instance_id,
-            // phantom : PhantomData,
-        }
-    }
-
-    pub fn get_server_uuid(&self) -> Uuid {
-        self.server_uuid
-    }
-
-    pub fn find_local_servers(
-        z: Arc<zenoh::Zenoh>,
-    ) -> impl std::future::Future<Output = ZRPCResult<Vec<Uuid>>> + 'static {
-        async move {
-            let ws = z.workspace(None).await?;
-            let zsession = z.session();
-            let zinfo = zsession.info().await;
-            let rid = zinfo
-                .get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY)
-                .ok_or(ZRPCError::MissingValue)?
-                .split(',')
-                .collect::<Vec<_>>()[0]
-                .to_uppercase();
-
-            let selector = zenoh::Selector::try_from(
-                "/zservice/Hello/00000000-0000-0000-0000-000000000001/*/state".to_string(),
-            )?;
-            let mut ds = ws.get(&selector).await?;
-            let mut servers = Vec::new();
-
-            while let Some(d) = ds.next().await {
-                match d.value {
-                    zenoh::Value::Raw(_, buf) => {
-                        let ca = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(
-                            &buf.to_vec(),
-                        )?;
-                        if ca.routerid == rid {
-                            servers.push(ca.uuid);
-                        }
-                    }
-                    _ => {
-                        return Err(ZRPCError::ZenohError(
-                            "Component state is expected to be RAW in Zenoh!!".to_string(),
-                        ))
-                    }
-                }
-            }
-            Ok(servers)
-        }
-    }
-
-    pub fn find_servers(
-        z: Arc<zenoh::Zenoh>,
-    ) -> impl std::future::Future<Output = ZRPCResult<Vec<Uuid>>> + 'static {
-        async move {
-            let ws = z.workspace(None).await?;
-            let selector = zenoh::Selector::try_from(
-                "/zservice/Hello/00000000-0000-0000-0000-000000000001/*/state".to_string(),
-            )?;
-            let mut ds = ws.get(&selector).await?;
-            let mut servers = Vec::new();
-
-            while let Some(d) = ds.next().await {
-                match d.value {
-                    zenoh::Value::Raw(_, buf) => {
-                        let ca = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(
-                            &buf.to_vec(),
-                        )?;
-                        servers.push(ca.uuid);
-                    }
-                    _ => {
-                        return Err(ZRPCError::ZenohError(
-                            "Component state is expected to be RAW in Zenoh!!".to_string(),
-                        ))
-                    }
-                }
-            }
-            Ok(servers)
-        }
-    }
-}
-
-impl HelloClient {
-    #[allow(unused)]
-    pub fn hello(
-        &self,
-        name: String,
-    ) -> impl std::future::Future<Output = ZRPCResult<String>> + '_ {
-        let request = HelloRequest::Hello { name };
-        // Timeout is implemented here
-        async move {
-            match self.ch.verify_server().await {
-                Ok(b) => match b {
-                    false => Err(ZRPCError::Unavailable),
-                    true => {
-                        let resp = self.ch.call_fun(request);
-                        let dur = Duration::from_secs(10);
-                        match async_std::future::timeout(dur, resp).await {
-                            Ok(r) => match r {
-                                Ok(zr) => match zr {
-                                    HelloResponse::Hello(msg) => Ok(msg),
-                                    _ => ::std::rt::begin_panic(
-                                        "internal error: entered unreachable code",
-                                    ),
-                                },
-                                Err(e) => Err(e),
-                            },
-                            Err(e) => Err(ZRPCError::TimedOut),
-                        }
-                    }
-                },
-                Err(e) => Err(e),
-            }
-        }
-    }
-
-    #[allow(unused)]
-    pub fn add(&self) -> impl std::future::Future<Output = ZRPCResult<u64>> + '_ {
-        let request = HelloRequest::Add;
-        // Timeout is implemented here
-        async move {
-            match self.ch.verify_server().await {
-                Ok(b) => match b {
-                    false => Err(ZRPCError::Unavailable),
-                    true => {
-                        let resp = self.ch.call_fun(request);
-                        let dur = Duration::from_secs(10);
-                        match async_std::future::timeout(dur, resp).await {
-                            Ok(r) => match r {
-                                Ok(zr) => match zr {
-                                    HelloResponse::Add(msg) => Ok(msg),
-                                    _ => ::std::rt::begin_panic(
-                                        "internal error: entered unreachable code",
-                                    ),
-                                },
-                                Err(e) => Err(e),
-                            },
-                            Err(e) => Err(ZRPCError::TimedOut),
-                        }
-                    }
-                },
-                Err(e) => Err(e),
-            }
-        }
-    }
-}
-
-#[async_std::main]
-async fn main() {
-    env_logger::init();
-
-    let zenoh = Arc::new(
-        Zenoh::new(Properties::from("mode=client;peer=tcp/127.0.0.1:7447").into())
-            .await
-            .unwrap(),
-    );
-    // let ws = Arc::new(zenoh.workspace(None).await.unwrap());
-
-    let service = HelloZService {
-        ser_name: "test service".to_string(),
-        counter: Arc::new(Mutex::new(0u64)),
-    };
-
-    let z = zenoh.clone();
-    let server = service.get_hello_server(z);
-    let instance_id = server.instance_uuid();
-    let client = HelloClient::new(zenoh.clone(), instance_id);
-
-    server.connect().await.unwrap(); //instance UUID is generated at this point
-
-    server.initialize().await.unwrap();
-    server.register().await.unwrap();
-
-    let local_servers = HelloClient::find_local_servers(zenoh.clone()).await;
-    println!("local_servers: {:?}", local_servers);
-
-    let servers = HelloClient::find_servers(zenoh.clone()).await;
-    println!("servers found: {:?}", servers);
-
-    // this returns an error as the server is not ready
-    let hello = client.hello("client".to_string()).await;
-    println!("Res is: {:?}", hello);
-
-    let (s, handle) = server.start().await.unwrap();
-
-    let local_servers = HelloClient::find_local_servers(zenoh.clone()).await;
-    println!("local_servers: {:?}", local_servers);
-
-    let servers = HelloClient::find_servers(zenoh.clone()).await;
-    println!("servers found: {:?}", servers);
-
-    task::sleep(Duration::from_secs(1)).await;
-    let hello = client.hello("client".to_string()).await;
-    println!("Res is: {:?}", hello);
-
-    let hello = client.hello("client_two".to_string()).await;
-    println!("Res is: {:?}", hello);
-
-    let hello = client.add().await;
-    println!("Res is: {:?}", hello);
-
-    let hello = client.add().await;
-    println!("Res is: {:?}", hello);
-
-    let hello = client.add().await;
-    println!("Res is: {:?}", hello);
-
-    server.stop(s).await.unwrap();
-
-    let local_servers = HelloClient::find_local_servers(zenoh.clone()).await;
-    println!("local_servers: {:?}", local_servers);
-
-    let servers = HelloClient::find_servers(zenoh.clone()).await;
-    println!("servers found: {:?}", servers);
-
-    server.unregister().await.unwrap();
-    server.disconnect().await.unwrap();
-
-    handle.await.unwrap();
-
-    // this returns an error as the server is not there
-    let hello = client.hello("client".to_string()).await;
-    println!("Res is: {:?}", hello);
-}
diff --git a/zrpc-macros/src/lib.rs b/zrpc-macros/src/lib.rs
deleted file mode 100644
index 101d3259..00000000
--- a/zrpc-macros/src/lib.rs
+++ /dev/null
@@ -1,1338 +0,0 @@
-/*********************************************************************************
-* Copyright (c) 2018,2020 ADLINK Technology Inc.
-*
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License 2.0 which is available at
-* http://www.eclipse.org/legal/epl-2.0, or the Apache Software License 2.0
-* which is available at https://www.apache.org/licenses/LICENSE-2.0.
-*
-* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
-* Contributors:
-*   ADLINK fog05 team, <fog05@adlink-labs.tech>
-*********************************************************************************/
-
-#![recursion_limit = "512"]
-
-extern crate base64;
-extern crate darling;
-extern crate proc_macro;
-extern crate proc_macro2;
-extern crate quote;
-extern crate serde;
-extern crate syn;
-
-use darling::FromMeta;
-use inflector::cases::snakecase::to_snake_case;
-use proc_macro::TokenStream;
-use proc_macro2::{Span, TokenStream as TokenStream2};
-use quote::{format_ident, quote, ToTokens};
-use std::str::FromStr;
-use syn::{
-    braced,
-    ext::IdentExt,
-    parenthesized,
-    parse::{Parse, ParseStream},
-    parse_macro_input, parse_quote,
-    spanned::Spanned,
-    token::Comma,
-    Attribute, AttributeArgs, Block, FnArg, Ident, ImplItem, ImplItemMethod, ImplItemType,
-    ItemImpl, Pat, PatType, Receiver, ReturnType, Token, Type, Visibility,
-};
-use uuid::Uuid;
-
-macro_rules! extend_errors {
-    ($errors: ident, $e: expr) => {
-        match $errors {
-            Ok(_) => $errors = Err($e),
-            Err(ref mut errors) => errors.extend($e),
-        }
-    };
-}
-
-#[derive(Debug, FromMeta)]
-struct ZServiceMacroArgs {
-    timeout_s: u16,
-    #[darling(default)]
-    prefix: Option<String>,
-    #[darling(default)]
-    service_uuid: Option<String>,
-}
-
-struct ZService {
-    attrs: Vec<Attribute>,
-    vis: Visibility,
-    ident: Ident,
-    evals: Vec<EvalMethod>,
-}
-
-impl Parse for ZService {
-    fn parse(input: ParseStream) -> syn::Result<Self> {
-        let attrs = input.call(Attribute::parse_outer)?;
-        let vis = input.parse()?;
-        input.parse::<Token![trait]>()?;
-        let ident: Ident = input.parse()?;
-        let content;
-        braced!(content in input);
-        let mut evals = Vec::<EvalMethod>::new();
-        while !content.is_empty() {
-            evals.push(content.parse()?);
-        }
-        let mut ident_errors = Ok(());
-        for eval in &evals {
-            if eval.ident == "new" {
-                extend_errors!(
-                    ident_errors,
-                    syn::Error::new(
-                        eval.ident.span(),
-                        format!(
-                            "method name conflicts with generated fn `{}Client::new`",
-                            ident.unraw()
-                        )
-                    )
-                );
-            }
-            if eval.ident == "serve" {
-                extend_errors!(
-                    ident_errors,
-                    syn::Error::new(
-                        eval.ident.span(),
-                        format!("method name conflicts with generated fn `{}::serve`", ident)
-                    )
-                );
-            }
-        }
-        ident_errors?;
-
-        Ok(Self {
-            attrs,
-            vis,
-            ident,
-            evals,
-        })
-    }
-}
-
-struct EvalMethod {
-    attrs: Vec<Attribute>,
-    ident: Ident,
-    nochk: Ident,
-    receiver: Receiver,
-    args: Vec<PatType>,
-    output: ReturnType,
-}
-
-impl Parse for EvalMethod {
-    fn parse(input: ParseStream) -> syn::Result<Self> {
-        let attrs = input.call(Attribute::parse_outer)?;
-        input.parse::<Token![async]>()?;
-        input.parse::<Token![fn]>()?;
-        let ident = input.parse()?;
-        let nochk = format_ident!("{}_nochk", ident);
-        let content;
-        let mut recv: Option<Receiver> = None;
-        parenthesized!(content in input);
-        let mut args = Vec::new();
-        let mut errors = Ok(());
-        for arg in content.parse_terminated::<FnArg, Comma>(FnArg::parse)? {
-            match arg {
-                FnArg::Typed(captured) if matches!(&*captured.pat, Pat::Ident(_)) => {
-                    args.push(captured);
-                }
-                FnArg::Typed(captured) => {
-                    extend_errors!(
-                        errors,
-                        syn::Error::new(captured.pat.span(), "patterns aren't allowed in RPC args")
-                    );
-                }
-                FnArg::Receiver(receiver) => {
-                    //Should take whatever used by the user and strip it for client
-                    recv = Some(receiver)
-                    // extend_errors!(
-                    //     errors,
-                    //     syn::Error::new(arg.span(), "method args cannot start with self, &mut self is added by the macro!")
-                    // );
-                }
-            }
-        }
-        match recv {
-            None => extend_errors!(
-                errors,
-                syn::Error::new(
-                    recv.span(),
-                    "Missing any receiver in method declaration, please add one!"
-                )
-            ),
-            Some(_) => (),
-        }
-
-        errors?;
-        let output = input.parse()?;
-        input.parse::<Token![;]>()?;
-        let receiver = recv.unwrap();
-
-        Ok(Self {
-            attrs,
-            ident,
-            nochk,
-            receiver,
-            args,
-            output,
-        })
-    }
-}
-
-/// Generates:
-/// - service trait
-/// - serve fn
-/// - client stub struct
-/// - new_stub client factory fn
-/// - Request and Response enums
-#[proc_macro_attribute]
-pub fn zservice(_attr: TokenStream, input: TokenStream) -> TokenStream {
-    let unit_type: &Type = &parse_quote!(());
-
-    //parsing the trait body
-    let ZService {
-        ref attrs,
-        ref vis,
-        ref ident,
-        ref evals,
-    } = parse_macro_input!(input as ZService);
-
-    //parsing the attributes to the macro
-    let attr_args = parse_macro_input!(_attr as AttributeArgs);
-    let macro_args = match ZServiceMacroArgs::from_list(&attr_args) {
-        Ok(v) => v,
-        Err(e) => {
-            return TokenStream::from(e.write_errors());
-        }
-    };
-
-    //converts the functions names from snake_case to CamelCase
-    let camel_case_fn_names: &Vec<_> = &evals
-        .iter()
-        .map(|eval| snake_to_camel(&eval.ident.unraw().to_string()))
-        .collect();
-
-    let snake_case_ident = to_snake_case(&ident.unraw().to_string());
-
-    // Collects the pattern for the types
-    let args: &[&[PatType]] = &evals.iter().map(|eval| &*eval.args).collect::<Vec<_>>();
-
-    let service_uuid = match macro_args.service_uuid {
-        Some(u) => Uuid::from_str(&u).unwrap(),
-        None => Uuid::new_v4(),
-    };
-
-    //service eval path
-    let path = match macro_args.prefix {
-        Some(prefix) => format!("{}/zservice/{}/{}/", prefix, ident, service_uuid),
-        None => format!("/zservice/{}/{}/", ident, service_uuid),
-    };
-
-    let service_name = format!("{}Service", ident);
-    // Generates the code
-    let ts: TokenStream = ZServiceGenerator {
-        service_ident: ident,
-        server_ident: &format_ident!("Serve{}", ident), //Server is called Serve<Trait Name>
-        client_ident: &format_ident!("{}Client", ident), //Client is called <Trait Name>Client
-        request_ident: &format_ident!("{}Request", ident), //Request type is called <Trait Name>Request
-        response_ident: &format_ident!("{}Response", ident), //Response type is called <Trait Name>Response
-        vis,
-        args,
-        method_attrs: &evals.iter().map(|eval| &*eval.attrs).collect::<Vec<_>>(), //getting evals attributes
-        method_idents: &evals.iter().map(|eval| &eval.ident).collect::<Vec<_>>(), //getting evals names
-        method_idents_nocheck: &evals.iter().map(|eval| &eval.nochk).collect::<Vec<_>>(), //getting evals names no check [TESTING]
-        attrs,
-        evals,
-        return_types: &evals //getting evals return type, if non present using unit
-            .iter()
-            .map(|eval| match eval.output {
-                ReturnType::Type(_, ref ty) => ty,
-                ReturnType::Default => unit_type,
-            })
-            .collect::<Vec<_>>(),
-        arg_pats: &args
-            .iter()
-            .map(|args| args.iter().map(|arg| &*arg.pat).collect())
-            .collect::<Vec<_>>(),
-        camel_case_idents: &evals
-            .iter()
-            .zip(camel_case_fn_names.iter())
-            .map(|(eval, name)| Ident::new(name, eval.ident.span()))
-            .collect::<Vec<_>>(),
-        timeout: &macro_args.timeout_s,
-        eval_path: &path,
-        service_name: &service_name,
-        service_get_server_ident: &format_ident!("get_{}_server", snake_case_ident),
-    }
-    .into_token_stream()
-    .into();
-    ts
-}
-
-/// Update the implementation of the trait
-#[proc_macro_attribute]
-pub fn zserver(_attr: TokenStream, input: TokenStream) -> TokenStream {
-    let mut item = syn::parse_macro_input!(input as ItemImpl);
-    let span = item.span();
-
-    // let attr_args = parse_macro_input!(_attr as AttributeArgs);
-
-    let mut expected_non_async_types: Vec<(&ImplItemMethod, String)> = Vec::new();
-    let mut found_non_async_types: Vec<&ImplItemType> = Vec::new();
-
-    for inner in &mut item.items {
-        match inner {
-            ImplItem::Method(method) => {
-                if method.sig.asyncness.is_some() {
-                    // if this function is declared async, transform it into a regular function
-                    method.sig.asyncness = None;
-                    // put the body inside an task::block_on(async {})
-                    let content = method.block.to_token_stream();
-                    // and add the  #[allow(unused,clippy::manual_async_fn)] attribute
-                    // let new_attr = TokenStream::from(quote!{
-                    //     #[allow(unused,clippy::manual_async_fn)]
-                    // });
-                    // let attrs = new_attr.call(Attribute::parse_outer).unwrap();
-                    // method.attrs.push(attrs);
-
-                    let updated_impl = TokenStream::from(quote! {
-                        {
-                            task::block_on(
-                                async move
-                                #content
-                            )
-                        }
-                    });
-                    method.block = parse_macro_input!(updated_impl as Block);
-                } else {
-                    // If it's not async, keep track of all required associated types for better
-                    // error reporting.
-                    expected_non_async_types.push((method, associated_type_for_eval(method)));
-                }
-            }
-            ImplItem::Type(typedecl) => found_non_async_types.push(typedecl),
-            _ => {}
-        }
-    }
-
-    if let Err(e) =
-        verify_types_were_provided(span, &expected_non_async_types, &found_non_async_types)
-    {
-        return TokenStream::from(e.to_compile_error());
-    }
-
-    // let uuid = match macro_args.uuid {
-    //     Some(u) => Uuid::from_str(&u).unwrap(),
-    //     None => Uuid::new_v4(),
-    // };
-
-    // let str_uuid = format!("{}", uuid);
-
-    // let uuid_imp = TokenStream::from(quote! {
-    //     fn instance_uuid(&self) -> uuid::Uuid {
-    //         Uuid::from_str(#str_uuid).unwrap()
-    //     }
-    // });
-
-    // let method = syn::parse_macro_input!(uuid_imp as syn::ImplItemMethod);
-
-    // item.items.push(ImplItem::Method(method));
-
-    TokenStream::from(quote!(#item))
-}
-
-/// Creates the type name for a future, to be removed...
-fn associated_type_for_eval(method: &ImplItemMethod) -> String {
-    snake_to_camel(&method.sig.ident.unraw().to_string()) + "Fut"
-}
-
-/// Verifies if the types are provide for each methods
-fn verify_types_were_provided(
-    span: Span,
-    expected: &[(&ImplItemMethod, String)],
-    provided: &[&ImplItemType],
-) -> syn::Result<()> {
-    let mut result = Ok(());
-    for (method, expected) in expected {
-        if !provided.iter().any(|typedecl| typedecl.ident == expected) {
-            let mut e = syn::Error::new(
-                span,
-                format!("not all trait items implemented, missing: `{}`", expected),
-            );
-            let fn_span = method.sig.fn_token.span();
-            e.extend(syn::Error::new(
-                fn_span.join(method.sig.ident.span()).unwrap_or(fn_span),
-                format!(
-                    "hint: `#[zerver]` only rewrites async fns, and `fn {}` is not async",
-                    method.sig.ident
-                ),
-            ));
-            match result {
-                Ok(_) => result = Err(e),
-                Err(ref mut error) => error.extend(Some(e)),
-            }
-        }
-    }
-    result
-}
-
-/// Generator for the ZService
-struct ZServiceGenerator<'a> {
-    service_ident: &'a Ident,               //service type
-    server_ident: &'a Ident,                //server type
-    client_ident: &'a Ident,                //client type
-    request_ident: &'a Ident,               //request type
-    response_ident: &'a Ident,              //response type
-    vis: &'a Visibility,                    //visibility
-    attrs: &'a [Attribute],                 //attributes
-    evals: &'a [EvalMethod],                //functions to be exposed via evals
-    camel_case_idents: &'a [Ident],         //camel case conversion of all names
-    method_idents: &'a [&'a Ident],         //type of the methods
-    method_idents_nocheck: &'a [&'a Ident], //type of the methods without check of the server [TESTING POURPOSE]
-    method_attrs: &'a [&'a [Attribute]],    //attributes of the methods
-    args: &'a [&'a [PatType]],              // types description pattern
-    return_types: &'a [&'a Type],           // return types of functions
-    arg_pats: &'a [Vec<&'a Pat>],           // patterns for args
-    timeout: &'a u16,                       //eval timeout
-    eval_path: &'a String,                  //path for evals
-    service_name: &'a String,               //service name on zenoh
-    service_get_server_ident: &'a Ident,    //the ident for the get_<trait>_server
-}
-
-impl<'a> ZServiceGenerator<'a> {
-    // crates the service trait
-    fn trait_service(&self) -> TokenStream2 {
-        let &Self {
-            attrs,
-            evals,
-            vis,
-            return_types,
-            service_ident,
-            server_ident,
-            service_get_server_ident,
-            ..
-        } = self;
-
-        let fns = evals.iter().zip(return_types.iter()).map(
-            |(
-                EvalMethod {
-                    attrs,
-                    ident,
-                    receiver,
-                    args,
-                    ..
-                },
-                output,
-            )| {
-                quote! {
-
-                    #(#attrs)*
-                    fn #ident(#receiver, #(#args),*) -> #output;
-                }
-            },
-        );
-
-        quote! {
-        #(#attrs)*
-        #vis trait #service_ident : Clone{
-            #(#fns)*
-
-            /// Returns the server object
-            fn #service_get_server_ident(self, z : async_std::sync::Arc<zenoh::Zenoh>, id : Option<uuid::Uuid>) -> #server_ident<Self>{
-                let id = id.unwrap_or(Uuid::new_v4());
-                log::trace!("Getting Server with ID {}", id);
-                #server_ident::new(z,self, id)
-                }
-            }
-
-        }
-    }
-
-    //creates the server struct
-    fn struct_server(&self) -> TokenStream2 {
-        let &Self {
-            vis, server_ident, ..
-        } = self;
-
-        quote! {
-            #[derive(Clone)]
-            #vis struct #server_ident<S> {
-                z : async_std::sync::Arc<zenoh::Zenoh>,
-                server: S,
-                instance_id: uuid::Uuid,
-            }
-
-            impl<S> #server_ident<S> {
-                pub fn new(z : Arc<zenoh::Zenoh>, server : S, id : uuid::Uuid) -> Self {
-                    Self {
-                        z,
-                        server,
-                        instance_id : id,
-                    }
-                }
-            }
-
-        }
-    }
-
-    // implements ZServe for the server
-    fn impl_serve_for_server(&self) -> TokenStream2 {
-        let &Self {
-            request_ident,
-            server_ident,
-            service_ident,
-            response_ident,
-            camel_case_idents,
-            arg_pats,
-            method_idents,
-            eval_path,
-            service_name,
-            ..
-        } = self;
-
-        quote! {
-
-
-            impl<S> zrpc::ZServe<#request_ident> for #server_ident<S>
-            where S: #service_ident + Send +'static
-            {
-                type Resp = #response_ident;
-
-                fn instance_uuid(&self) -> uuid::Uuid {
-                    self.instance_id
-                }
-
-                #[allow(clippy::type_complexity,clippy::manual_async_fn)]
-                fn connect(&'_ self) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>>+ '_>> {
-                    log::trace!("Connect Service {} Instance {}", #service_name, self.instance_uuid());
-
-                    async fn __connect<S>(_self: &#server_ident<S>) -> ZRPCResult<()>
-                    where
-                        S: #service_ident + Send + 'static,
-                    {
-
-                        let zsession = _self.z.session();
-                        let zinfo = zsession.info().await;
-                        let pid = zinfo.get(&zenoh::net::info::ZN_INFO_PID_KEY).ok_or(ZRPCError::MissingValue)?.to_uppercase();
-                        let rid = zinfo.get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY).ok_or(ZRPCError::MissingValue)?.split(",").collect::<Vec<_>>()[0].to_uppercase();
-                        let ws = _self.z.workspace(None).await?;
-
-
-                        let component_info = zrpc::ComponentState{
-                            uuid : _self.instance_uuid(),
-                            name : format!("{}", #service_name),
-                            routerid : rid.clone().to_uppercase(),
-                            peerid : pid.clone().to_uppercase(),
-                            status : zrpc::ComponentStatus::HALTED,
-                        };
-                        let encoded_ci = zrpc::serialize::serialize_state(&component_info)?;
-                        let path = zenoh::Path::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-
-                        ws.put(&path.into(),encoded_ci.into()).await?;
-
-                        let selector = zenoh::Selector::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                        let max_retries = 10_000;
-                        let mut i = 0;
-
-                        loop {
-                            let ds = ws.get(&selector).await?;
-                            let data : Vec<zenoh::Data> = ds.collect().await;
-                            if data.len() > 0 {
-                                return Ok(())
-                            }
-                            if i >= max_retries {
-                                return Err(ZRPCError::ZenohError("Unable to check component state, did you miss a zenoh storage?".to_string()))
-                            }
-                            i += 1;
-                        }
-
-
-                    }
-                    Box::pin(__connect(self))
-                }
-
-
-                #[allow(clippy::type_complexity,clippy::manual_async_fn)]
-                fn initialize(&self) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-                    log::trace!("Initialize Service {} Instance {}", #service_name, self.instance_uuid());
-
-                    fn check(data : &Vec<zenoh::Data>) -> ZRPCResult<bool> {
-                        match data.len() {
-                            0 => Ok(false),
-                            1 => {
-                                let kv = &data[0];
-                                match &kv.value {
-                                    zenoh::Value::Raw(_,buf) => {
-                                        let mut ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                                        if ci.status == zrpc::ComponentStatus::INITIALIZING {
-                                            return Ok(true);
-                                        }
-                                        Ok(false)
-                                    },
-                                    _ => Ok(false),
-                                }
-                            }
-                            _ => Ok(false),
-                        }
-                    }
-
-                    async fn __initialize<S>(_self: &#server_ident<S>) -> ZRPCResult<()>
-                    where
-                        S: #service_ident + Send + 'static,
-                    {
-                            let selector = zenoh::Selector::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                            let ws = _self.z.workspace(None).await?;
-                            let ds = ws.get(&selector).await?;
-                            let data : Vec<zenoh::Data> = ds.collect().await;
-                            match data.len() {
-                                0 => Err(ZRPCError::NotFound),
-                                1 => {
-                                    let kv = &data[0];
-                                    match &kv.value {
-                                        zenoh::Value::Raw(_,buf) => {
-                                            let mut ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                                            match ci.status {
-                                                zrpc::ComponentStatus::HALTED => {
-                                                    ci.status = zrpc::ComponentStatus::INITIALIZING;
-                                                    let encoded_ci = zrpc::serialize::serialize_state(&ci)?;
-                                                    let path = zenoh::Path::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                                                    ws.put(&path,encoded_ci.into()).await?;
-
-                                                    // This checks if the state is updated in zenoh
-                                                    let selector = zenoh::Selector::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                                                    let max_retries = 10_000;
-                                                    let mut i = 0;
-
-                                                    loop {
-                                                        let ds = ws.get(&selector).await?;
-                                                        let data : Vec<zenoh::Data> = ds.collect().await;
-                                                        if check(&data)? {
-                                                            return Ok(())
-                                                        }
-                                                        if i >= max_retries {
-                                                            return Err(ZRPCError::ZenohError("Unable to check component state, did you miss a zenoh storage?".to_string()))
-                                                        }
-                                                        i += 1;
-                                                    }
-
-
-                                                },
-                                                _ => Err(ZRPCError::StateTransitionNotAllowed("Cannot initialize a component in a state different than HALTED".to_string())),
-                                            }
-                                        },
-                                        _ => Err(ZRPCError::ZenohError(
-                                            "Component state is expected to be RAW in Zenoh!!".to_string()
-                                        )),
-                                    }
-                                },
-                                _ => Err(ZRPCError::Unreachable),
-                            }
-                    }
-                    Box::pin(__initialize(self))
-                }
-
-                #[allow(clippy::type_complexity,clippy::manual_async_fn)]
-                fn register(&self) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>>{
-                    log::trace!("Register Service {} Instance {}", #service_name, self.instance_uuid());
-
-                    fn check(data : &Vec<zenoh::Data>) -> ZRPCResult<bool> {
-                        match data.len() {
-                            0 => Ok(false),
-                            1 => {
-                                let kv = &data[0];
-                                match &kv.value {
-                                    zenoh::Value::Raw(_,buf) => {
-                                        let mut ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                                        if ci.status == zrpc::ComponentStatus::REGISTERED {
-                                            return Ok(true);
-                                        }
-                                        Ok(false)
-                                    },
-                                    _ => Ok(false),
-                                }
-                            }
-                            _ => Ok(false),
-                        }
-                    }
-
-
-                    async fn __register<S>(_self: &#server_ident<S>) -> ZRPCResult<()>
-                    where
-                    S: #service_ident + Send + 'static,
-                    {
-                            let selector = zenoh::Selector::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                            let ws = _self.z.workspace(None).await?;
-                            let ds = ws.get(&selector).await?;
-                            let data : Vec<zenoh::Data> = ds.collect().await;
-                            match data.len() {
-                                0 => Err(ZRPCError::NotFound),
-                                1 => {
-                                    let kv = &data[0];
-                                    match &kv.value {
-                                        zenoh::Value::Raw(_,buf) => {
-                                            let mut ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                                            match ci.status {
-                                                zrpc::ComponentStatus::INITIALIZING => {
-                                                    ci.status = zrpc::ComponentStatus::REGISTERED;
-                                                    let encoded_ci = zrpc::serialize::serialize_state(&ci)?;
-                                                    let path = zenoh::Path::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                                                    ws.put(&path,encoded_ci.into()).await?;
-
-
-                                                    // This checks if the state is updated in zenoh
-                                                    let selector = zenoh::Selector::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                                                    let max_retries = 10_000;
-                                                    let mut i = 0;
-                                                    loop {
-                                                        let ds = ws.get(&selector).await?;
-                                                        let data : Vec<zenoh::Data> = ds.collect().await;
-                                                        if check(&data)? {
-                                                            return Ok(())
-                                                        }
-                                                        if i >= max_retries {
-                                                            return Err(ZRPCError::ZenohError("Unable to check component state, did you miss a zenoh storage?".to_string()))
-                                                        }
-                                                        i += 1;
-                                                    }
-                                                },
-                                                _ => Err(ZRPCError::StateTransitionNotAllowed("Cannot register a component in a state different than INITIALIZING".to_string())),
-                                            }
-                                        },
-                                        _ => Err(ZRPCError::ZenohError("Component state is expected to be RAW in Zenoh!!".to_string())),
-                                    }
-                                },
-                                _ => Err(ZRPCError::Unreachable),
-                            }
-                        }
-                    Box::pin(__register(self))
-                }
-
-                #[allow(clippy::type_complexity,clippy::manual_async_fn)]
-                fn start(
-                    &self,
-                ) -> ::core::pin::Pin<
-                    Box<
-                        dyn std::future::Future<
-                                Output = ZRPCResult<(async_std::channel::Sender<()>, async_std::task::JoinHandle<ZRPCResult<()>>)>,
-                            > + '_,
-                    >,
-                > {
-                    log::trace!("Start Service {} Instance {}", #service_name, self.instance_uuid());
-
-                    fn check(data : &Vec<zenoh::Data>) -> ZRPCResult<bool> {
-                        match data.len() {
-                            0 => Ok(false),
-                            1 => {
-                                let kv = &data[0];
-                                match &kv.value {
-                                    zenoh::Value::Raw(_,buf) => {
-                                        let mut ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                                        if ci.status == zrpc::ComponentStatus::SERVING {
-                                            return Ok(true);
-                                        }
-                                        Ok(false)
-                                    },
-                                    _ => Ok(false),
-                                }
-                            }
-                            _ => Ok(false),
-                        }
-                    }
-
-
-                    async fn __start<S>(
-                        _self: &#server_ident<S>,
-                    ) -> ZRPCResult<(async_std::channel::Sender<()>, async_std::task::JoinHandle<ZRPCResult<()>>)>
-                    where
-                        S: #service_ident + Send + 'static,
-                    {
-                            let (s, r) = async_std::channel::bounded::<()>(1);
-                            let selector = zenoh::Selector::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                            let ws = _self.z.workspace(None).await?;
-                            let ds = ws.get(&selector).await?;
-                            let data : Vec<zenoh::Data> = ds.collect().await;
-                            match data.len() {
-                                0 => Err(ZRPCError::NotFound),
-                                1 => {
-                                    let kv = &data[0];
-                                    match &kv.value {
-                                        zenoh::Value::Raw(_,buf) => {
-                                            let mut ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                                            match ci.status {
-                                                zrpc::ComponentStatus::REGISTERED => {
-                                                    ci.status = zrpc::ComponentStatus::SERVING;
-                                                    let encoded_ci = zrpc::serialize::serialize_state(&ci)?;
-                                                    let path = zenoh::Path::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                                                    ws.put(&path.into(),encoded_ci.into()).await?;
-
-                                                    // This checks if the state is updated in zenoh
-                                                    let selector = zenoh::Selector::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                                                    let max_retries = 10_000;
-                                                    let mut i = 0;
-
-                                                    loop {
-                                                        let ds = ws.get(&selector).await?;
-                                                        let data : Vec<zenoh::Data> = ds.collect().await;
-                                                        if check(&data)? {
-                                                            break
-                                                        }
-                                                        if i >= max_retries {
-                                                            return Err(ZRPCError::ZenohError("Unable to check component state, did you miss a zenoh storage?".to_string()))
-                                                        }
-                                                        i += 1;
-                                                    }
-
-
-                                                    let server = _self.clone();
-                                                    let h = async_std::task::spawn_blocking(move || {
-                                                        async_std::task::block_on(async {
-                                                            server.serve(r).await
-                                                        })
-                                                    });
-                                                    Ok((s,h))
-                                                },
-                                                _ => Err(ZRPCError::StateTransitionNotAllowed("Cannot start a component in a state different than REGISTERED".to_string())),
-                                            }
-                                        },
-                                        _ => Err(ZRPCError::ZenohError("Component state is expected to be RAW in Zenoh!!".to_string())),
-                                    }
-                                },
-                                _ => Err(ZRPCError::Unreachable),
-                            }
-                    }
-                    Box::pin(__start(self))
-                }
-
-                #[allow(clippy::type_complexity,clippy::manual_async_fn)]
-                fn serve(
-                    &self,
-                    stop: async_std::channel::Receiver<()>,
-                ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-                    log::trace!("Serve Service {} Instance {}", #service_name, self.instance_uuid());
-                    async fn __serve<S>(_self: &#server_ident<S>, _stop: async_std::channel::Receiver<()>) -> ZRPCResult<()>
-                    where
-                        S: #service_ident + Send + 'static,
-                    {
-                        let selector = zenoh::Selector::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                        let ws = _self.z.workspace(None).await?;
-                        let ds = ws.get(&selector).await?;
-                        let data : Vec<zenoh::Data> = ds.collect().await;
-                        match data.len() {
-                            0 => Err(ZRPCError::NotFound),
-                            1 => {
-                                let kv = &data[0];
-                                match &kv.value {
-                                    zenoh::Value::Raw(_,buf) => {
-                                        let ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                                        match ci.status {
-                                            zrpc::ComponentStatus::SERVING => {
-                                                let path = zenoh::Path::try_from(format!("{}/{}/eval",#eval_path, _self.instance_uuid()))?;
-                                                log::trace!("Registering eval on {:?}", path);
-                                                let mut rcv = ws.register_eval(&path.clone().into()).await?;
-                                                log::trace!("Registered on {:?}", path);
-                                                let rcv_loop = async {
-                                                    loop {
-                                                        let get_request = rcv.next().await.ok_or_else(|| async_std::channel::RecvError)?;
-                                                        let base64_req = get_request.selector.properties.get("req").cloned().ok_or_else(|| async_std::channel::RecvError)?;
-                                                        let b64_bytes = base64::decode(base64_req).map_err(|_| async_std::channel::RecvError)?;
-                                                        let req = zrpc::serialize::deserialize_request::<#request_ident>(&b64_bytes).map_err(|_| async_std::channel::RecvError)?;
-                                                        log::trace!("Received on {:?} {:?}", path, req);
-
-                                                        let mut ser = _self.server.clone();
-                                                        let gr = get_request.clone();
-                                                        let p = path.clone();
-                                                        //log::trace!("Spawning task to respond to {:?}", req);
-
-                                                        match req.clone() {
-                                                            #(
-                                                                #request_ident::#camel_case_idents{#(#arg_pats),*} => {
-                                                                    let resp = #response_ident::#camel_case_idents(ser.#method_idents( #(#arg_pats),*));
-                                                                    log::trace!("Reply to {:?} {:?} with {:?}", path, req, resp);
-                                                                    let encoded =  zrpc::serialize::serialize_response(&resp).map_err(|_| async_std::channel::RecvError)?;
-                                                                    gr.reply(p, encoded.into()).await;
-                                                                    log::trace!("Response {:?} sent", resp);
-                                                                }
-                                                            )*
-                                                        }
-                                                    }
-                                                };
-                                                Ok(rcv_loop.race(_stop.recv()).await.map_err(|e| ZRPCError::Error(format!("{}", e)))?)
-                                            },
-                                            _ => Err(ZRPCError::StateTransitionNotAllowed("State is not WORK, serve called directly? serve is called by calling work!".to_string())),
-                                        }
-                                    },
-                                    _ => Err(ZRPCError::ZenohError("Component state is expected to be RAW in Zenoh!!".to_string())),
-                                }
-                            },
-                            _ => Err(ZRPCError::Unreachable),
-                        }
-                    }
-                    Box::pin(__serve(self, stop))
-                }
-
-                #[allow(clippy::type_complexity,clippy::manual_async_fn)]
-                fn stop(
-                    &self,
-                    stop: async_std::channel::Sender<()>,
-                ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-                    log::trace!("Stop Service {} Instance {}", #service_name, self.instance_uuid());
-
-                    fn check(data : &Vec<zenoh::Data>) -> ZRPCResult<bool> {
-                        match data.len() {
-                            0 => Ok(false),
-                            1 => {
-                                let kv = &data[0];
-                                match &kv.value {
-                                    zenoh::Value::Raw(_,buf) => {
-                                        let mut ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                                        if ci.status == zrpc::ComponentStatus::REGISTERED {
-                                            return Ok(true);
-                                        }
-                                        Ok(false)
-                                    },
-                                    _ => Ok(false),
-                                }
-                            }
-                            _ => Ok(false),
-                        }
-                    }
-
-                    async fn __stop<S>(_self: &#server_ident<S>, _stop: async_std::channel::Sender<()>) -> ZRPCResult<()>
-                    where
-                        S: #service_ident + Send + 'static,
-                    {
-                            let selector = zenoh::Selector::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                            let ws = _self.z.workspace(None).await?;
-                            let ds = ws.get(&selector).await?;
-                            let data : Vec<zenoh::Data> = ds.collect().await;
-                            match data.len() {
-                                0 => Err(ZRPCError::NotFound),
-                                1 => {
-                                    let kv = &data[0];
-                                    match &kv.value {
-                                        zenoh::Value::Raw(_,buf) => {
-                                            let mut ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                                            match ci.status {
-                                                zrpc::ComponentStatus::SERVING => {
-                                                    ci.status = zrpc::ComponentStatus::REGISTERED;
-                                                    let encoded_ci = zrpc::serialize::serialize_state(&ci)?;
-                                                    let path = zenoh::Path::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                                                    ws.put(&path.into(),encoded_ci.into()).await?;
-
-                                                    // This checks if the state is updated in zenoh
-                                                    let selector = zenoh::Selector::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                                                    let max_retries = 10_000;
-                                                    let mut i = 0;
-                                                    loop {
-                                                        let ds = ws.get(&selector).await?;
-                                                        let data : Vec<zenoh::Data> = ds.collect().await;
-                                                        if check(&data)? {
-                                                            break
-                                                        }
-                                                        if i >= max_retries {
-                                                            return Err(ZRPCError::ZenohError("Unable to check component state, did you miss a zenoh storage?".to_string()))
-                                                        }
-                                                        i += 1;
-                                                    }
-
-                                                    Ok(_stop.send(()).await?)
-                                                },
-                                                _ => Err(ZRPCError::StateTransitionNotAllowed("Cannot stop a component in a state different than WORK".to_string())),
-                                            }
-                                        },
-                                        _ => Err(ZRPCError::ZenohError("Component state is expected to be RAW in Zenoh!!".to_string())),
-                                    }
-                                },
-                                _ => Err(ZRPCError::Unreachable),
-                            }
-                        }
-                    Box::pin(__stop(self, stop))
-                }
-
-                #[allow(clippy::type_complexity,clippy::manual_async_fn)]
-                fn unregister(&self) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>> {
-                    log::trace!("Unregister Service {} Instance {}", #service_name, self.instance_uuid());
-
-                    fn check(data : &Vec<zenoh::Data>) -> ZRPCResult<bool> {
-                        match data.len() {
-                            0 => Ok(false),
-                            1 => {
-                                let kv = &data[0];
-                                match &kv.value {
-                                    zenoh::Value::Raw(_,buf) => {
-                                        let mut ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                                        if ci.status == zrpc::ComponentStatus::HALTED {
-                                            return Ok(true);
-                                        }
-                                        Ok(false)
-                                    },
-                                    _ => Ok(false),
-                                }
-                            }
-                            _ => Ok(false),
-                        }
-                    }
-
-                    async fn __unregister<S>(_self: &#server_ident<S>) -> ZRPCResult<()>
-                    where
-                        S: #service_ident + Send + 'static,
-                    {
-                            let selector = zenoh::Selector::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                            let ws = _self.z.workspace(None).await?;
-                            let ds = ws.get(&selector).await?;
-                            let data : Vec<zenoh::Data> = ds.collect().await;
-                            match data.len() {
-                                0 => Err(ZRPCError::NotFound),
-                                1 => {
-                                    let kv = &data[0];
-                                    match &kv.value {
-                                        zenoh::Value::Raw(_,buf) => {
-                                            let mut ci = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                                            match ci.status {
-                                                zrpc::ComponentStatus::REGISTERED => {
-                                                    ci.status = zrpc::ComponentStatus::HALTED;
-                                                    let encoded_ci = zrpc::serialize::serialize_state(&ci)?;
-                                                    let path = zenoh::Path::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                                                    ws.put(&path.into(),encoded_ci.into()).await?;
-
-
-                                                    // This checks if the state is updated in zenoh
-                                                    let selector = zenoh::Selector::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                                                    let max_retries = 10_000;
-                                                    let mut i = 0;
-                                                    loop {
-                                                        let ds = ws.get(&selector).await?;
-                                                        let data : Vec<zenoh::Data> = ds.collect().await;
-                                                        if check(&data)? {
-                                                            return Ok(())
-                                                        }
-                                                        if i >= max_retries {
-                                                            return Err(ZRPCError::ZenohError("Unable to check component state, did you miss a zenoh storage?".to_string()))
-                                                        }
-                                                        i += 1;
-                                                    }
-
-                                                },
-                                                _ => Err(ZRPCError::StateTransitionNotAllowed("Cannot unregister a component in a state different than REGISTERED".to_string())),
-                                            }
-                                        },
-                                        _ => Err(ZRPCError::ZenohError("Component state is expected to be RAW in Zenoh!!".to_string())),
-                                    }
-                                },
-                                _ => Err(ZRPCError::Unreachable),
-                            }
-                        }
-                    Box::pin(__unregister(self))
-                }
-
-                #[allow(clippy::type_complexity,clippy::manual_async_fn)]
-                fn disconnect(self) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>>>> {
-                    log::trace!("Disconnect Service {} Instance {}", #service_name, self.instance_uuid());
-                    async fn __disconnect<S>(_self: #server_ident<S>) -> ZRPCResult<()>
-                    where
-                        S: #service_ident + Send + 'static,
-                        {
-                            let ws = _self.z.workspace(None).await?;
-                            let path = zenoh::Path::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                            ws.delete(&path).await?;
-
-
-                            let selector = zenoh::Selector::try_from(format!("/{}/{}/state",#eval_path,_self.instance_uuid()))?;
-                            let max_retries = 10_000;
-                            let mut i = 0;
-
-                            loop {
-                                let ds = ws.get(&selector).await?;
-                                let data : Vec<zenoh::Data> = ds.collect().await;
-                                if data.len() == 0 {
-                                    return Ok(())
-                                }
-                                if i >= max_retries {
-                                    return Err(ZRPCError::ZenohError("Unable to check component state, did you miss a zenoh storage?".to_string()))
-                                }
-                                i += 1;
-                            }
-
-                        }
-                    Box::pin(__disconnect(self))
-                }
-
-            }
-        }
-    }
-
-    // Generates the request enum type, and makes it derive Debug, Serialize and Deserialize
-    fn enum_request(&self) -> TokenStream2 {
-        let &Self {
-            vis,
-            request_ident,
-            camel_case_idents,
-            args,
-            ..
-        } = self;
-
-        quote! {
-            /// The request sent over the wire from the client to the server.
-            #[derive(Debug, serde::Serialize, serde::Deserialize, Clone)]
-            #vis enum #request_ident {
-                #( #camel_case_idents{ #( #args ),* } ),*
-            }
-        }
-    }
-
-    // Generates the response enum type, and makes it derive Debug, Serialize and Deserialize
-    fn enum_response(&self) -> TokenStream2 {
-        let &Self {
-            vis,
-            response_ident,
-            camel_case_idents,
-            return_types,
-            ..
-        } = self;
-
-        quote! {
-            /// The response sent over the wire from the server to the client.
-            #[derive(Debug, serde::Serialize, serde::Deserialize, Clone)]
-            #vis enum #response_ident {
-                #( #camel_case_idents(#return_types) ),*
-            }
-        }
-    }
-
-    // Generates the client struct
-    fn struct_client(&self) -> TokenStream2 {
-        let &Self {
-            vis,
-            client_ident,
-            request_ident,
-            response_ident,
-            ..
-        } = self;
-
-        quote! {
-            #[allow(unused)]
-            #[derive(Clone, Debug)]
-            #vis struct #client_ident<C = zrpc::ZClientChannel<#request_ident, #response_ident>>{
-                ch : C,
-                server_uuid : Uuid,
-            }
-        }
-    }
-
-    // Generates the implentation of the client
-    fn impl_client_new_find_servers(&self) -> TokenStream2 {
-        let &Self {
-            client_ident,
-            vis,
-            eval_path,
-            ..
-        } = self;
-
-        quote! {
-            impl #client_ident {
-                #vis fn new(
-                    z : async_std::sync::Arc<zenoh::Zenoh>,
-                    instance_id : uuid::Uuid
-                ) -> #client_ident {
-                        let new_client = zrpc::ZClientChannel::new(z, format!("{}",#eval_path), Some(instance_id));
-                        #client_ident{
-                            ch : new_client,
-                            server_uuid : instance_id,
-                        }
-
-                    }
-
-                #vis fn get_server_uuid(&self) -> Uuid {
-                    self.server_uuid
-                }
-
-
-
-
-                #vis fn find_local_servers(
-                    z : async_std::sync::Arc<zenoh::Zenoh>
-                ) -> impl std::future::Future<Output = ZRPCResult<Vec<uuid::Uuid>>> + 'static
-                {
-                    async move {
-                        let ws = z.workspace(None).await?;
-                        let zsession = z.session();
-                        let zinfo = zsession.info().await;
-                        let rid = zinfo.get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY).ok_or(ZRPCError::MissingValue)?.split(",").collect::<Vec<_>>()[0].to_uppercase();
-
-                        let selector = zenoh::Selector::try_from(format!("{}/*/state",#eval_path))?;
-                        let mut ds = ws.get(&selector).await?;
-                        let mut servers = Vec::new();
-
-                        while let Some(d) = ds.next().await {
-                            match d.value {
-                                zenoh::Value::Raw(_,buf) => {
-                                    let ca = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                                    if ca.routerid == rid {
-                                        servers.push(ca.uuid);
-                                    }
-                                },
-                                _ => return Err(ZRPCError::ZenohError("Component state is expected to be RAW in Zenoh!!".to_string()))
-                            }
-                        }
-                        Ok(servers)
-                    }
-                }
-
-
-                #vis fn find_servers(
-                    z : async_std::sync::Arc<zenoh::Zenoh>
-                ) -> impl std::future::Future<Output = ZRPCResult<Vec<uuid::Uuid>>> + 'static
-                {
-                    async move {
-                        let ws = z.workspace(None).await?;
-
-                        let selector = zenoh::Selector::try_from(format!("{}/*/state",#eval_path))?;
-                        let mut ds = ws.get(&selector).await?;
-                        let mut servers = Vec::new();
-
-                        while let Some(d) = ds.next().await {
-                            match d.value {
-                                zenoh::Value::Raw(_,buf) => {
-                                    let ca = zrpc::serialize::deserialize_state::<zrpc::ComponentState>(&buf.to_vec())?;
-                                    servers.push(ca.uuid);
-                                },
-                                _ => return Err(ZRPCError::ZenohError("Component state is expected to be RAW in Zenoh!!".to_string())),
-                            }
-                        }
-                        Ok(servers)
-                    }
-                    }
-
-
-
-            }
-
-        }
-    }
-
-    // Generates the implementation of the client methods that maps to evals
-    fn impl_client_eval_methods(&self) -> TokenStream2 {
-        let &Self {
-            client_ident,
-            request_ident,
-            response_ident,
-            method_attrs,
-            vis,
-            method_idents,
-            method_idents_nocheck,
-            args,
-            return_types,
-            arg_pats,
-            camel_case_idents,
-            timeout,
-            ..
-        } = self;
-
-        quote! {
-            impl #client_ident {
-
-
-                #vis fn verify_server(&self
-                ) -> impl std::future::Future<Output = ZRPCResult<bool>> + '_ {
-                    async move {
-                        self.ch.verify_server().await
-                    }
-                }
-
-                #(
-                    #[allow(unused,clippy::manual_async_fn)]
-                    #( #method_attrs )*
-                    #vis fn #method_idents(&self, #( #args ),*)
-                        -> impl std::future::Future<Output = ZRPCResult<#return_types>> + '_ {
-                        let request = #request_ident::#camel_case_idents { #( #arg_pats ),* };
-                        log::trace!("Sending {:?}", request);
-                        async move {
-                            match self.ch.verify_server().await {
-                                Ok(b) => {
-                                    match b {
-                                        false => Err(ZRPCError::Unavailable),
-                                        true => {
-                                            let resp = self.ch.call_fun(request);
-                                            let dur = std::time::Duration::from_secs(#timeout as u64);
-                                            match async_std::future::timeout(dur, resp).await {
-                                                Ok(r) => match r {
-                                                    Ok(zr) => match zr {
-                                                            #response_ident::#camel_case_idents(msg) => std::result::Result::Ok(msg),
-                                                            _ => Err(ZRPCError::Unreachable),
-                                                        },
-                                                    Err(e) => Err(e),
-                                                },
-                                                Err(e) => Err(ZRPCError::TimedOut),
-                                            }
-                                        }
-                                    }
-                                },
-                                Err(e) => Err(e),
-                            }
-                        }
-                    }
-
-                    #[allow(unused,clippy::manual_async_fn)]
-                    #( #method_attrs )*
-                    #vis fn #method_idents_nocheck(&self, #( #args ),*)
-                        -> impl std::future::Future<Output = ZRPCResult<#return_types>> + '_ {
-                        let request = #request_ident::#camel_case_idents { #( #arg_pats ),* };
-                        log::trace!("Sending {:?}", request);
-                        async move {
-                            let resp = self.ch.call_fun(request);
-                            let dur = std::time::Duration::from_secs(#timeout as u64);
-                            match async_std::future::timeout(dur, resp).await {
-                                Ok(r) => match r {
-                                    Ok(zr) => match zr {
-                                            #response_ident::#camel_case_idents(msg) => std::result::Result::Ok(msg),
-                                            _ => Err(ZRPCError::Unreachable),
-                                        },
-                                    Err(e) => Err(e),
-                                },
-                                Err(e) => Err(ZRPCError::TimedOut),
-                            }
-                        }
-                    }
-                )*
-            }
-        }
-    }
-}
-
-//Converts ZServiceGenerator to actual code
-impl<'a> ToTokens for ZServiceGenerator<'a> {
-    fn to_tokens(&self, output: &mut TokenStream2) {
-        output.extend(vec![
-            self.trait_service(),
-            self.struct_server(),
-            self.impl_serve_for_server(),
-            self.enum_request(),
-            self.enum_response(),
-            self.struct_client(),
-            self.impl_client_new_find_servers(),
-            self.impl_client_eval_methods(),
-        ])
-    }
-}
-
-//converts to snake_case to CamelCase, is used to convert functions name
-fn snake_to_camel(ident_str: &str) -> String {
-    let mut camel_ty = String::with_capacity(ident_str.len());
-
-    let mut last_char_was_underscore = true;
-    for c in ident_str.chars() {
-        match c {
-            '_' => last_char_was_underscore = true,
-            c if last_char_was_underscore => {
-                camel_ty.extend(c.to_uppercase());
-                last_char_was_underscore = false;
-            }
-            c => camel_ty.extend(c.to_lowercase()),
-        }
-    }
-
-    camel_ty.shrink_to_fit();
-    camel_ty
-}
diff --git a/zrpc-perf/Cargo.toml b/zrpc-perf/Cargo.toml
deleted file mode 100644
index 966adf7f..00000000
--- a/zrpc-perf/Cargo.toml
+++ /dev/null
@@ -1,50 +0,0 @@
-[package]
-name = "zrpc-perf"
-version = "0.3.0-alpha1"
-repository = "https://github.com/eclipse-fog05/fog05"
-homepage = "http://fog05.io"
-authors = ["gabrik <gabriele.baldoni@gmail.com>"]
-edition = "2018"
-license = " EPL-2.0 OR Apache-2.0"
-description = "fog05: The End-to-End Compute, Storage and Networking Virtualisation solution."
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-# To build with debug on macros: RUSTFLAGS="-Z macro-backtrace"
-
-[dependencies]
-async-std = { version = "=1.9.0", features = ["attributes"] }
-futures = "0.3.5"
-syn = { version = "1.0.11", features = ["full"] }
-quote = "1.0.2"
-proc-macro2 = "1.0.6"
-serde_derive = "1.0.55"
-serde = { version = "1.0.55", features = ["derive"] }
-zenoh = { git = "https://github.com/eclipse-zenoh/zenoh.git", rev = "cf124d6c4d393e65662d1e1caf567b66af7150d5" }
-zrpc = {path = "../zrpc"}
-zrpc-macros = {path = "../zrpc-macros"}
-znrpc-macros = {path = "../znrpc-macros"}
-base64 = "0.13.0"
-log = "0.4.11"
-uuid = { version = "0.8.1", features = ["serde", "v4"] }
-darling = "0.12.0"
-Inflector = "0.11.4"
-bincode = "1.3.1"
-serde_json = "1.0.55"
-env_logger = "0.8.3"
-clap = "2.33"
-structopt = "0.3.13"
-uhlc = "0.2"
-tonic = "0.4.0"
-prost = "0.7.0"
-tokio = { version = "1.2.0", features = ["macros", "rt", "rt-multi-thread"]}
-
-[build-dependencies]
-tonic-build = "0.4.0"
-
-
-[profile.release]
-debug=false
-lto="fat"
-codegen-units=1
-opt-level=3
-panic="abort"
\ No newline at end of file
diff --git a/zrpc-perf/build.rs b/zrpc-perf/build.rs
deleted file mode 100644
index 3ffa9636..00000000
--- a/zrpc-perf/build.rs
+++ /dev/null
@@ -1,4 +0,0 @@
-fn main() -> Result<(), Box<dyn std::error::Error>> {
-    tonic_build::compile_protos("proto/bench.proto")?;
-    Ok(())
-}
diff --git a/zrpc-perf/plots.r b/zrpc-perf/plots.r
deleted file mode 100644
index 61fcc4b6..00000000
--- a/zrpc-perf/plots.r
+++ /dev/null
@@ -1,144 +0,0 @@
-library(ggplot2)
-library(cowplot)
-library(tidyverse)
-library(cowplot)
-library(hrbrthemes)
-library(viridis)
-library(readr)
-
-setwd(".")
-
-# The logs to read for 8K batches
-read_dir <- function(file_name) {
-  read_csv(file_name)
-}
-
-lower_ci <- function(mean, se, n, conf_level = 0.95){
-  lower_ci <- mean - qt(1 - ((1 - conf_level) / 2), n - 1) * se
-}
-
-upper_ci <- function(mean, se, n, conf_level = 0.95){
-  upper_ci <- mean + qt(1 - ((1 - conf_level) / 2), n - 1) * se
-}
-
-logdir <- c("./results");
-
-data_files <- c();
- for(ld in logdir) {
-   data_files <- c(data_files, list.files(ld, pattern = "*.csv", full.names=TRUE));
-}
- 
-raw_data <- data_files %>%
-   map_df(~ read_dir(.))
-
-raw_data <- raw_data %>% filter(MSGS>0) %>% filter(RTT_US>0) %>% mutate(MBIT_THR = THR/1024/1024)
-
-sizes = c(8,16,32, 64, 128,256,512,1024,2048,4096,8192,16384,32768,65536)
-
-
-## Getting statistics
-data <- raw_data %>% group_by(SIZE,KIND) %>% summarise( MEAN_MSGS = mean(MSGS),
-                                                        SD_MSGS=sd(MSGS),
-                                                        MEAN_THR= mean(MBIT_THR),
-                                                        SD_THR=sd(MBIT_THR),
-                                                        MEAN_RTT= mean(RTT_US),
-                                                        MEDIAN_RTT=median(RTT_US),
-                                                        COUNT = n()
-                                            ) %>% mutate (
-                                              SE_MSGS= (SD_MSGS) / sqrt(COUNT),
-                                              SE_THR = (SD_THR) / sqrt(COUNT),
-                                              LCI_MSGS = lower_ci(MEAN_MSGS, SE_MSGS, COUNT),
-                                              UCI_MSGS = upper_ci(MEAN_MSGS, SE_MSGS, COUNT),
-                                              LCI_THR = lower_ci(MEAN_THR, SE_THR, COUNT),
-                                              UCI_THR = upper_ci(MEAN_THR, SE_THR, COUNT),
-                                            )
-
-
-data <- data %>% filter(KIND!="ZNRPC-RESP-SER" & KIND!="ZNRPC-RESP-DE")
-
-# p_msgs <- ggplot(data=data, aes(x=factor(SIZE), y=MEAN_MSGS, fill=KIND)) +
-#   geom_bar(stat="identity", position="dodge") + scale_y_log10()
-# 
-# plot(p_msgs)
-# 
-# p_rtt <- ggplot(data=data, aes(x=factor(SIZE), y=MEAN_RTT, fill=KIND)) +
-#   geom_bar(stat="identity", position="dodge") + scale_y_log10()
-# 
-# plot(p_rtt)
-# 
-# ggsave("zrpc-msgs.pdf",plot = p_msgs, width = 10, height = 10, limitsize = TRUE);
-# ggsave("zrpc-rtt.pdf",plot = p_rtt, width = 10, height = 10, limitsize = TRUE);
-
-
-p_msgs<-ggplot(data=data, aes(x=factor(SIZE), y=MEAN_MSGS, colour=KIND, group=KIND)) +
-  geom_point(size=2) +
-  geom_line() +
-  #scale_y_log10() +
-  geom_errorbar(aes(ymin=MEAN_MSGS-SE_MSGS, ymax=MEAN_MSGS+SE_MSGS), colour="black", width=.2) +
-  scale_x_discrete(breaks = sizes, labels = sizes) +
-  ggtitle("zrpc zenoh comparison msg/s localhost") +
-  xlab("Payload size") + ylab("msg/s")
-plot(p_msgs)
-
-
-p_thr<-ggplot(data=data, aes(x=factor(SIZE), y=MEAN_THR, colour=KIND, group=KIND)) +
-  geom_point(size=2) +
-  geom_line() +
-  scale_y_log10() +
-  geom_errorbar(aes(ymin=MEAN_THR-SE_THR, ymax=MEAN_THR+SE_THR), colour="black", width=.2) +
-  scale_x_discrete(breaks = sizes, labels = sizes) +
-  ggtitle("zrpc zenoh comparison throughput localhost") +
-  xlab("Payload size") + ylab("Mbit/s")
-plot(p_thr)
-
-
-p_rtt<-ggplot(data=data, aes(x=factor(SIZE), y=MEAN_RTT, colour=KIND, group=KIND)) +
-  geom_point(size=2) +
-  geom_line() +
-  #scale_y_log10() +
-  scale_x_discrete(breaks = sizes, labels = sizes) +
-  ggtitle("zrpc zenoh comparison rtt localhost") +
-  xlab("Payload size") + ylab("RTT µS")
-plot(p_rtt)
-
-#p_rtt_median<-ggplot(data=data, aes(x=factor(SIZE), y=MEDIAN_RTT, colour=KIND, group=KIND))
-#  geom_point(size=2) +
-#  geom_line() +
-#  scale_y_log10() +
-#  scale_x_discrete(breaks = sizes, labels = sizes) +
-#  ggtitle("zrpc zenoh comparison median rtt localhost") +
-#  xlab("Payload size") + ylab("RTT µS")
-#plot(p_rtt_median)
-
-
-#dist_data <- raw_data %>% filter(SIZE==8)  %>% filter(KIND=="QUERY" | KIND=="QUERY-EVAL" | KIND=="P2P-QUERY-EVAL")  
-
-# dist_data <- raw_data %>% filter(SIZE==8)
-# 
-# 
-# p_rtt_dist<-ggplot(data=dist_data, aes(x=RTT_US, colour=KIND, group=KIND)) +
-#   geom_density() +
-#   #scale_y_log10() +
-#   ggtitle("zenoh rtt density plot 8 byte") +
-#   xlab("RTT µS") + ylab("Probability")
-# plot(p_rtt_dist)
-# 
-# cmp_data <- data %>% filter(KIND=="PP-ZNRPC" |  KIND=="PP-QUERY-EVAL" | KIND=="GRPC-CLIENT" ) 
-# p_msgs_cmp<-ggplot(data=cmp_data, aes(x=factor(SIZE), y=MEAN_MSGS, colour=KIND, group=KIND)) +
-#   geom_point(size=2) +
-#   geom_line() +
-#   #  scale_y_log10() +
-#   geom_errorbar(aes(ymin=MEAN_MSGS-SE_MSGS, ymax=MEAN_MSGS+SE_MSGS), colour="black", width=.2) +
-#   scale_x_discrete(breaks = sizes, labels = sizes) +
-#   ggtitle("zrpc zenoh comparison msg/s localhost") +
-#   xlab("Payload size") + ylab("msg/s")
-# plot(p_msgs_cmp)
-# 
-# 
-
-ggsave("msgs-comparison.pdf",plot = p_msgs, width = 10, height = 10, limitsize = TRUE);
-ggsave("thr-comparison.pdf",plot = p_thr, width = 10, height = 10, limitsize = TRUE);
-ggsave("rtt-comparison.pdf",plot = p_rtt, width = 10, height = 10, limitsize = TRUE);
-#ggsave("rtt-median-comparison.pdf",plot = p_rtt_median, width = 10, height = 10, limitsize = TRUE);
-
-print("Done")
\ No newline at end of file
diff --git a/zrpc-perf/proto/bench.proto b/zrpc-perf/proto/bench.proto
deleted file mode 100644
index cee3cd4e..00000000
--- a/zrpc-perf/proto/bench.proto
+++ /dev/null
@@ -1,12 +0,0 @@
-syntax = "proto3";
-package bench;
-
-service Bencher {
-    rpc Bench (BenchRequest) returns (BenchReply);
-}
-
-message BenchRequest {}
-
-message BenchReply {
-    bytes data = 1;
-}
\ No newline at end of file
diff --git a/zrpc-perf/src/bin/deserialization.rs b/zrpc-perf/src/bin/deserialization.rs
deleted file mode 100644
index 19d35746..00000000
--- a/zrpc-perf/src/bin/deserialization.rs
+++ /dev/null
@@ -1,94 +0,0 @@
-#![allow(clippy::manual_async_fn)]
-#![allow(clippy::large_enum_variant)]
-#[macro_use]
-extern crate std;
-
-use async_std::sync::Arc;
-use async_std::task;
-use futures::prelude::*;
-use std::convert::TryFrom;
-use std::sync::atomic::{AtomicU64, Ordering};
-use std::time::{Duration, Instant};
-use structopt::StructOpt;
-use zenoh::*;
-
-use async_std::prelude::FutureExt;
-
-use std::str;
-use uuid::Uuid;
-use zrpc::zrpcresult::{ZRPCError, ZRPCResult};
-use znrpc_macros::{znservice};
-
-static DEFAULT_INT: &str = "5";
-static DEFAULT_SIZE: &str = "8";
-static DEFAULT_DURATION: &str = "60";
-
-#[derive(StructOpt, Debug)]
-struct CallArgs {
-    /// Config file
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-    #[structopt(short, long, default_value = DEFAULT_INT)]
-    interveal: u64,
-    #[structopt(short, long, default_value = DEFAULT_DURATION)]
-    duration: u64,
-}
-
-#[znservice(
-    timeout_s = 60,
-    prefix = "/test",
-    service_uuid = "00000000-0000-0000-0000-000000000001"
-)]
-pub trait Bench {
-    async fn bench(&self) -> Vec<u8>;
-}
-
-
-#[async_std::main]
-async fn main() {
-    // initiate logging
-    env_logger::init();
-
-    let args = CallArgs::from_args();
-    let rtts = Arc::new(AtomicU64::new(0));
-    let count: Arc<AtomicU64> = Arc::new(AtomicU64::new(0));
-
-    let kind = "ZNRPC-RESP-DE";
-
-    let c = count.clone();
-    let s = args.size;
-    let i = args.interveal;
-    let rt = rtts.clone();
-    println!("MSGS,SIZE,THR,INTERVEAL,RTT_US,KIND");
-    task::spawn(async move {
-        loop {
-            task::sleep(Duration::from_secs(i)).await;
-            let n = c.swap(0, Ordering::AcqRel);
-            let r = rt.swap(0, Ordering::AcqRel);
-            let msgs = n / i;
-            let thr = (n * s * 8) / i;
-            let rtt = if n == 0 { 0f64 } else { (r as f64) / (n as f64) } as f64;
-            println!("{},{},{},{},{},{}", msgs, s, thr, i, rtt, kind);
-        }
-    });
-
-    let d = args.duration;
-    task::spawn(async move {
-        task::sleep(Duration::from_secs(d)).await;
-        std::process::exit(0);
-    });
-
-
-    let data = vec![0; args.size as usize];
-    let resp = BenchResponse::Bench(data);
-    let serialized = zrpc::serialize::serialize_response(&resp).unwrap();
-
-    loop {
-        let now_q = Instant::now();
-        let _d : BenchResponse = zrpc::serialize::deserialize_response(&serialized.clone()).unwrap();
-        count.fetch_add(1, Ordering::AcqRel);
-        rtts.fetch_add(now_q.elapsed().as_micros() as u64, Ordering::AcqRel);
-    }
-
-}
-
diff --git a/zrpc-perf/src/bin/eval.rs b/zrpc-perf/src/bin/eval.rs
deleted file mode 100644
index 4b41c1be..00000000
--- a/zrpc-perf/src/bin/eval.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-use futures::prelude::*;
-use std::convert::TryFrom;
-use structopt::StructOpt;
-use zenoh::*;
-
-static DEFAULT_MODE: &str = "peer";
-static DEFAULT_SIZE: &str = "8";
-
-#[derive(StructOpt, Debug)]
-struct GetArgs {
-    /// Config file
-    #[structopt(short, long, default_value = DEFAULT_MODE)]
-    mode: String,
-    #[structopt(short, long)]
-    peer: Option<String>,
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-}
-
-#[async_std::main]
-async fn main() {
-    let args = GetArgs::from_args();
-
-    let properties = match args.peer {
-        Some(peer) => format!("mode={};peer={}", args.mode, peer),
-        None => format!("mode={}", args.mode),
-    };
-    let zproperties = Properties::from(properties);
-    let zenoh = Zenoh::new(zproperties.into()).await.unwrap();
-    let ws = zenoh.workspace(None).await.unwrap();
-
-    let path = &Path::try_from("/test/eval").unwrap();
-
-    let data: Vec<u8> = vec![0; args.size as usize];
-    let mut get_stream = ws.register_eval(&path.into()).await.unwrap();
-    while let Some(get_request) = get_stream.next().await {
-        get_request.reply(path.clone(), data.clone().into()).await;
-    }
-}
diff --git a/zrpc-perf/src/bin/gclient.rs b/zrpc-perf/src/bin/gclient.rs
deleted file mode 100644
index f2b7ffdc..00000000
--- a/zrpc-perf/src/bin/gclient.rs
+++ /dev/null
@@ -1,74 +0,0 @@
-use std::sync::Arc;
-use tokio::task;
-
-pub mod bench {
-    tonic::include_proto!("bench");
-}
-
-use bench::bencher_client::BencherClient;
-use bench::BenchRequest;
-
-use std::sync::atomic::{AtomicU64, Ordering};
-use std::time::{Duration, Instant};
-use structopt::StructOpt;
-
-static DEFAULT_ADDRESS: &str = "127.0.0.1:50001";
-static DEFAULT_INT: &str = "5";
-static DEFAULT_SIZE: &str = "8";
-static DEFAULT_DURATION: &str = "60";
-
-#[derive(StructOpt, Debug)]
-struct ClientArgs {
-
-    #[structopt(short, long, default_value = DEFAULT_ADDRESS)]
-    address: String,
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-    #[structopt(short, long, default_value = DEFAULT_INT)]
-    interveal: u64,
-    #[structopt(short, long, default_value = DEFAULT_DURATION)]
-    duration: u64,
-}
-
-#[tokio::main(worker_threads=1)]
-async fn main() -> Result<(), Box<dyn std::error::Error>> {
-    let args = ClientArgs::from_args();
-
-    let rtts = Arc::new(AtomicU64::new(0));
-    let count: Arc<AtomicU64> = Arc::new(AtomicU64::new(0));
-
-    let kind = "GRPC-CLIENT";
-
-    let mut client = BencherClient::connect(format!("http://{}", args.address)).await?;
-
-
-
-    let c = count.clone();
-    let s = args.size;
-    let i = args.interveal;
-    let rt = rtts.clone();
-
-    println!("MSGS,SIZE,THR,INTERVEAL,RTT_US,KIND");
-    task::spawn(async move {
-        loop {
-            tokio::time::sleep(Duration::from_secs(i)).await;
-            let n = c.swap(0, Ordering::AcqRel);
-            let r = rt.swap(0, Ordering::AcqRel);
-            let msgs = n / i;
-            let thr = (n * s * 8) / i;
-            let rtt = if n == 0 { 0 } else { r / n };
-            println!("{},{},{},{},{},{}", msgs, s, thr, i, rtt, kind);
-        }
-    });
-
-    let start = Instant::now();
-
-    while start.elapsed() < Duration::from_secs(args.duration) {
-        let now_q = Instant::now();
-        let request = tonic::Request::new(BenchRequest{});
-        let _r = client.bench(request).await.unwrap();
-        count.fetch_add(1, Ordering::AcqRel);
-        rtts.fetch_add(now_q.elapsed().as_micros() as u64, Ordering::AcqRel);
-    }
-    Ok(())
-}
diff --git a/zrpc-perf/src/bin/get.rs b/zrpc-perf/src/bin/get.rs
deleted file mode 100644
index e59e39f9..00000000
--- a/zrpc-perf/src/bin/get.rs
+++ /dev/null
@@ -1,88 +0,0 @@
-use async_std::sync::Arc;
-use async_std::task;
-use futures::prelude::*;
-use std::convert::TryFrom;
-use std::convert::TryInto;
-use std::sync::atomic::{AtomicU64, Ordering};
-use std::time::{Duration, Instant};
-use structopt::StructOpt;
-use zenoh::*;
-
-static DEFAULT_MODE: &str = "peer";
-static DEFAULT_SIZE: &str = "8";
-static DEFAULT_INT: &str = "5";
-static DEFAULT_DURATION: &str = "60";
-
-#[derive(StructOpt, Debug)]
-struct GetArgs {
-    /// Config file
-    #[structopt(short, long, default_value = DEFAULT_MODE)]
-    mode: String,
-    #[structopt(short, long)]
-    peer: Option<String>,
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-    #[structopt(short, long, default_value = DEFAULT_INT)]
-    interveal: u64,
-    #[structopt(short, long, default_value = DEFAULT_DURATION)]
-    duration: u64,
-}
-
-#[async_std::main]
-async fn main() {
-    let args = GetArgs::from_args();
-
-    let rtts = Arc::new(AtomicU64::new(0));
-    let count: Arc<AtomicU64> = Arc::new(AtomicU64::new(0));
-
-    let properties = match args.peer {
-        Some(peer) => format!("mode={};peer={}", args.mode, peer),
-        None => format!("mode={}", args.mode),
-    };
-    let zproperties = Properties::from(properties);
-    let zenoh = Zenoh::new(zproperties.into()).await.unwrap();
-    let ws = zenoh.workspace(None).await.unwrap();
-
-    let selector = Selector::try_from(format!("/test/{}", args.size)).unwrap();
-
-    let kind = if args.mode == "peer" {
-        "PR-GET"
-    } else {
-        "CR-GET"
-    };
-
-    let path = format!("/test/{}", args.size);
-    let data = vec![0; args.size as usize];
-    ws.put(&path.try_into().unwrap(), data.into())
-        .await
-        .unwrap();
-
-    println!("MSGS,SIZE,THR,INTERVEAL,RTT_US,KIND");
-    let c = count.clone();
-    let s = args.size;
-    let i = args.interveal;
-    let rt = rtts.clone();
-    task::spawn(async move {
-        loop {
-            task::sleep(Duration::from_secs(i)).await;
-            let n = c.swap(0, Ordering::AcqRel);
-            let r = rt.swap(0, Ordering::AcqRel);
-            let msgs = n / i;
-            let thr = (n * s * 8) / i;
-            let rtt = if n == 0 { 0 } else { r / n };
-            println!("{},{},{},{},{},{}", msgs, s, thr, i, rtt, kind);
-        }
-    });
-
-    let start = Instant::now();
-
-    while start.elapsed() < Duration::from_secs(args.duration) {
-        let now_q = Instant::now();
-        let mut data_stream = ws.get(&selector).await.unwrap();
-        while data_stream.next().await.is_some() {}
-        count.fetch_add(1, Ordering::AcqRel);
-        rtts.fetch_add(now_q.elapsed().as_micros() as u64, Ordering::AcqRel);
-    }
-
-    zenoh.close().await.unwrap();
-}
diff --git a/zrpc-perf/src/bin/get_eval.rs b/zrpc-perf/src/bin/get_eval.rs
deleted file mode 100644
index 121b7547..00000000
--- a/zrpc-perf/src/bin/get_eval.rs
+++ /dev/null
@@ -1,82 +0,0 @@
-use async_std::sync::Arc;
-use async_std::task;
-use futures::prelude::*;
-use std::convert::TryFrom;
-use std::sync::atomic::{AtomicU64, Ordering};
-use std::time::{Duration, Instant};
-use structopt::StructOpt;
-use zenoh::*;
-
-static DEFAULT_MODE: &str = "peer";
-static DEFAULT_INT: &str = "5";
-static DEFAULT_SIZE: &str = "8";
-static DEFAULT_DURATION: &str = "60";
-
-#[derive(StructOpt, Debug)]
-struct GetArgs {
-    /// Config file
-    #[structopt(short, long, default_value = DEFAULT_MODE)]
-    mode: String,
-    #[structopt(short, long)]
-    peer: Option<String>,
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-    #[structopt(short, long, default_value = DEFAULT_INT)]
-    interveal: u64,
-    #[structopt(short, long, default_value = DEFAULT_DURATION)]
-    duration: u64,
-}
-
-#[async_std::main]
-async fn main() {
-    let args = GetArgs::from_args();
-
-    let rtts = Arc::new(AtomicU64::new(0));
-    let count: Arc<AtomicU64> = Arc::new(AtomicU64::new(0));
-
-    println!("MSGS,SIZE,THR,INTERVEAL,RTT_US,KIND");
-    let properties = match args.peer {
-        Some(peer) => format!("mode={};peer={}", args.mode, peer),
-        None => format!("mode={}", args.mode),
-    };
-
-    let kind = if args.mode == "peer" {
-        "PP-GET-EVAL"
-    } else {
-        "CRC-GET-EVAL"
-    };
-
-    let zproperties = Properties::from(properties);
-    let zenoh = Zenoh::new(zproperties.into()).await.unwrap();
-    let ws = zenoh.workspace(None).await.unwrap();
-
-    let path = Selector::try_from("/test/eval".to_string()).unwrap();
-
-    let c = count.clone();
-    let s = args.size;
-    let i = args.interveal;
-    let rt = rtts.clone();
-    task::spawn(async move {
-        loop {
-            task::sleep(Duration::from_secs(i)).await;
-            let n = c.swap(0, Ordering::AcqRel);
-            let r = rt.swap(0, Ordering::AcqRel);
-            let msgs = n / i;
-            let thr = (n * s * 8) / i;
-            let rtt = if n == 0 { 0 } else { r / n };
-            println!("{},{},{},{},{},{}", msgs, s, thr, i, rtt, kind);
-        }
-    });
-
-    let start = Instant::now();
-
-    while start.elapsed() < Duration::from_secs(args.duration) {
-        let now_q = Instant::now();
-        let mut data_stream = ws.get(&path).await.unwrap();
-        while data_stream.next().await.is_some() {}
-        count.fetch_add(1, Ordering::AcqRel);
-        rtts.fetch_add(now_q.elapsed().as_micros() as u64, Ordering::AcqRel);
-    }
-
-    zenoh.close().await.unwrap();
-}
diff --git a/zrpc-perf/src/bin/gserver.rs b/zrpc-perf/src/bin/gserver.rs
deleted file mode 100644
index 5effb604..00000000
--- a/zrpc-perf/src/bin/gserver.rs
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-use tonic::{transport::Server, Request, Response, Status};
-
-pub mod bench {
-    tonic::include_proto!("bench");
-}
-
-
-use structopt::StructOpt;
-use bench::bencher_server::{Bencher, BencherServer};
-use bench::{BenchReply, BenchRequest};
-
-
-
-static DEFAULT_ADDRESS: &str = "127.0.0.1:50001";
-static DEFAULT_SIZE: &str = "8";
-
-#[derive(StructOpt, Debug)]
-struct ServerArgs {
-    /// Config file
-    #[structopt(short, long, default_value = DEFAULT_ADDRESS)]
-    address: String,
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-}
-
-
-#[derive(Debug, Default)]
-pub struct MyBench {
-    data: Vec<u8>,
-}
-
-#[tonic::async_trait]
-impl Bencher for MyBench {
-    async fn bench(&self, _request: Request<BenchRequest>) -> Result<Response<BenchReply>, Status> {
-        let reply = bench::BenchReply {
-            data: self.data.clone(),
-        };
-        Ok(Response::new(reply))
-    }
-}
-
-
-
-#[tokio::main(worker_threads=1)]
-async fn main() -> Result<(), Box<dyn std::error::Error>> {
-
-    let args = ServerArgs::from_args();
-
-    let addr = args.address.parse()?;
-
-    let data = vec![0; args.size as usize];
-
-    let greeter = MyBench{data};
-
-    Server::builder()
-        .add_service(BencherServer::new(greeter))
-        .serve(addr)
-        .await?;
-
-    Ok(())
-}
diff --git a/zrpc-perf/src/bin/net_sub_thr.rs b/zrpc-perf/src/bin/net_sub_thr.rs
deleted file mode 100644
index ff89d81c..00000000
--- a/zrpc-perf/src/bin/net_sub_thr.rs
+++ /dev/null
@@ -1,82 +0,0 @@
-use async_std::sync::Arc;
-use async_std::task;
-use std::sync::atomic::{AtomicU64, Ordering};
-use std::time::Duration;
-use structopt::StructOpt;
-use zenoh::net::ResKey::*;
-use zenoh::net::*;
-use zenoh::Properties;
-
-static DEFAULT_MODE: &str = "peer";
-static DEFAULT_SIZE: &str = "8";
-static DEFAULT_INT: &str = "5";
-static DEFAULT_DURATION: &str = "60";
-
-#[derive(StructOpt, Debug)]
-struct GetArgs {
-    /// Config file
-    #[structopt(short, long, default_value = DEFAULT_MODE)]
-    mode: String,
-    #[structopt(short, long)]
-    peer: Option<String>,
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-    #[structopt(short, long, default_value = DEFAULT_INT)]
-    interveal: u64,
-    #[structopt(short, long, default_value = DEFAULT_DURATION)]
-    duration: u64,
-}
-
-#[async_std::main]
-async fn main() {
-    let args = GetArgs::from_args();
-    let count: Arc<AtomicU64> = Arc::new(AtomicU64::new(0));
-
-    //Fields are the same for each test,
-    // if they do not make sense they are set to 0
-    let properties = match args.peer {
-        Some(peer) => format!("mode={};peer={}", args.mode, peer),
-        None => format!("mode={}", args.mode),
-    };
-    let zproperties = Properties::from(properties);
-    let session = zenoh::net::open(zproperties.into()).await.unwrap();
-
-    let reskey = RId(session
-        .declare_resource(&RName("/test/thr".to_string()))
-        .await
-        .unwrap());
-
-    let sub_info = SubInfo {
-        reliability: Reliability::Reliable,
-        mode: SubMode::Push,
-        period: None,
-    };
-
-    let kind = if args.mode == "peer" {
-        "PP-NET-SUB"
-    } else {
-        "CRC-NET-SUB"
-    };
-    println!("MSGS,SIZE,THR,INTERVEAL,RTT_US,KIND");
-    let c = count.clone();
-    let s = args.size;
-    let i = args.interveal;
-    task::spawn(async move {
-        loop {
-            task::sleep(Duration::from_secs(i)).await;
-            let n = c.swap(0, Ordering::AcqRel);
-            let msgs = n / i;
-            let thr = (n * s * 8) / i;
-            println!("{},{},{},{},{},{}", msgs, s, thr, i, 0, kind);
-        }
-    });
-
-    let _subscriber = session
-        .declare_callback_subscriber(&reskey, &sub_info, move |_sample| {
-            count.fetch_add(1, Ordering::AcqRel);
-        })
-        .await
-        .unwrap();
-
-    task::sleep(Duration::from_secs(args.duration)).await;
-}
diff --git a/zrpc-perf/src/bin/put_thr.rs b/zrpc-perf/src/bin/put_thr.rs
deleted file mode 100644
index f421529d..00000000
--- a/zrpc-perf/src/bin/put_thr.rs
+++ /dev/null
@@ -1,40 +0,0 @@
-use std::convert::TryFrom;
-use structopt::StructOpt;
-use zenoh::*;
-
-static DEFAULT_MODE: &str = "peer";
-static DEFAULT_SIZE: &str = "8";
-
-#[derive(StructOpt, Debug)]
-struct PutArgs {
-    /// Config file
-    #[structopt(short, long, default_value = DEFAULT_MODE)]
-    mode: String,
-    #[structopt(short, long)]
-    peer: Option<String>,
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-}
-
-#[async_std::main]
-async fn main() {
-    let args = PutArgs::from_args();
-
-    //println!("Args {:?}", args);
-
-    let properties = match args.peer {
-        Some(peer) => format!("mode={};peer={}", args.mode, peer),
-        None => format!("mode={}", args.mode),
-    };
-    let zproperties = Properties::from(properties);
-    let zenoh = Zenoh::new(zproperties.into()).await.unwrap();
-    let ws = zenoh.workspace(None).await.unwrap();
-
-    let path: Path = Path::try_from("/test/thr").unwrap();
-    let data = vec![0; args.size as usize];
-    let value = Value::from(data);
-
-    loop {
-        ws.put(&path, value.clone()).await.unwrap();
-    }
-}
diff --git a/zrpc-perf/src/bin/query.rs b/zrpc-perf/src/bin/query.rs
deleted file mode 100644
index 1120d590..00000000
--- a/zrpc-perf/src/bin/query.rs
+++ /dev/null
@@ -1,105 +0,0 @@
-#![feature(integer_atomics)]
-
-use async_std::sync::Arc;
-use async_std::task;
-use futures::prelude::*;
-use std::convert::TryInto;
-use std::sync::atomic::{AtomicU64, Ordering};
-use std::time::{Duration, Instant};
-use structopt::StructOpt;
-use zenoh::*;
-
-static DEFAULT_MODE: &str = "peer";
-static DEFAULT_SIZE: &str = "8";
-static DEFAULT_INT: &str = "5";
-static DEFAULT_DURATION: &str = "60";
-
-#[derive(StructOpt, Debug)]
-struct GetArgs {
-    /// Config file
-    #[structopt(short, long, default_value = DEFAULT_MODE)]
-    mode: String,
-    #[structopt(short, long)]
-    peer: Option<String>,
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-    #[structopt(short, long, default_value = DEFAULT_INT)]
-    interveal: u64,
-    #[structopt(short, long, default_value = DEFAULT_DURATION)]
-    duration: u64,
-}
-
-#[async_std::main]
-async fn main() {
-    let args = GetArgs::from_args();
-
-    let rtts = Arc::new(AtomicU64::new(0));
-    let count: Arc<AtomicU64> = Arc::new(AtomicU64::new(0));
-
-    let properties = match args.peer {
-        Some(peer) => format!("mode={};peer={}", args.mode, peer),
-        None => format!("mode={}", args.mode),
-    };
-    let zproperties = Properties::from(properties);
-    let session = zenoh::net::open(zproperties.clone().into()).await.unwrap();
-
-    let zenoh = Zenoh::new(zproperties.into()).await.unwrap();
-    let ws = zenoh.workspace(None).await.unwrap();
-    let path = format!("/test/{}", args.size);
-    let data = vec![0; args.size as usize];
-    ws.put(&path.try_into().unwrap(), data.into())
-        .await
-        .unwrap();
-    zenoh.close().await.unwrap();
-
-    let reskey = net::ResKey::RId(
-        session
-            .declare_resource(&net::ResKey::RName(format!("/test/{}", args.size)))
-            .await
-            .unwrap(),
-    );
-
-    println!("MSGS,SIZE,THR,INTERVEAL,RTT_US,KIND");
-    let kind = if args.mode == "peer" {
-        "PP-QUERY"
-    } else {
-        "CR-QUERY"
-    };
-    let c = count.clone();
-    let s = args.size;
-    let i = args.interveal;
-    let rt = rtts.clone();
-    task::spawn(async move {
-        loop {
-            task::sleep(Duration::from_secs(i)).await;
-            let n = c.swap(0, Ordering::AcqRel);
-            let r = rt.swap(0, Ordering::AcqRel);
-            let msgs = n / i;
-            let thr = (n * s * 8) / i;
-            let rtt = if n == 0 { 0 } else { r / n };
-            println!("{},{},{},{},{},{}", msgs, s, thr, i, rtt, kind);
-        }
-    });
-
-    let d = args.duration;
-    task::spawn(async move {
-        task::sleep(Duration::from_secs(d)).await;
-        std::process::exit(0);
-    });
-
-    loop {
-        let now_q = Instant::now();
-        let mut replies = session
-            .query(
-                &reskey,
-                "",
-                net::QueryTarget::default(),
-                net::QueryConsolidation::default(),
-            )
-            .await
-            .unwrap();
-        while replies.next().await.is_some() {}
-        count.fetch_add(1, Ordering::AcqRel);
-        rtts.fetch_add(now_q.elapsed().as_micros() as u64, Ordering::AcqRel);
-    }
-}
diff --git a/zrpc-perf/src/bin/query_eval.rs b/zrpc-perf/src/bin/query_eval.rs
deleted file mode 100644
index e04345e5..00000000
--- a/zrpc-perf/src/bin/query_eval.rs
+++ /dev/null
@@ -1,95 +0,0 @@
-#![feature(integer_atomics)]
-
-use async_std::sync::Arc;
-use async_std::task;
-use futures::prelude::*;
-use std::sync::atomic::{AtomicU64, Ordering};
-use std::time::{Duration, Instant};
-use structopt::StructOpt;
-use zenoh::*;
-
-static DEFAULT_MODE: &str = "peer";
-static DEFAULT_SIZE: &str = "8";
-static DEFAULT_INT: &str = "5";
-static DEFAULT_DURATION: &str = "60";
-
-#[derive(StructOpt, Debug)]
-struct GetArgs {
-    /// Config file
-    #[structopt(short, long, default_value = DEFAULT_MODE)]
-    mode: String,
-    #[structopt(short, long)]
-    peer: Option<String>,
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-    #[structopt(short, long, default_value = DEFAULT_INT)]
-    interveal: u64,
-    #[structopt(short, long, default_value = DEFAULT_DURATION)]
-    duration: u64,
-}
-
-#[async_std::main]
-async fn main() {
-    let args = GetArgs::from_args();
-
-    let rtts = Arc::new(AtomicU64::new(0));
-    let count: Arc<AtomicU64> = Arc::new(AtomicU64::new(0));
-
-    let properties = match args.peer {
-        Some(peer) => format!("mode={};peer={}", args.mode, peer),
-        None => format!("mode={}", args.mode),
-    };
-    let zproperties = Properties::from(properties);
-    let session = zenoh::net::open(zproperties.clone().into()).await.unwrap();
-
-    let reskey = net::ResKey::RId(
-        session
-            .declare_resource(&net::ResKey::RName("/test/eval".to_string()))
-            .await
-            .unwrap(),
-    );
-
-    println!("MSGS,SIZE,THR,INTERVEAL,RTT_US,KIND");
-    let kind = if args.mode == "peer" {
-        "PP-QUERY-EVAL"
-    } else {
-        "CRC-QUERY-EVAL"
-    };
-    let c = count.clone();
-    let s = args.size;
-    let i = args.interveal;
-    let rt = rtts.clone();
-    task::spawn(async move {
-        loop {
-            task::sleep(Duration::from_secs(i)).await;
-            let n = c.swap(0, Ordering::AcqRel);
-            let r = rt.swap(0, Ordering::AcqRel);
-            let msgs = n / i;
-            let thr = (n * s * 8) / i;
-            let rtt = if n == 0 { 0 } else { r / n };
-            println!("{},{},{},{},{},{}", msgs, s, thr, i, rtt, kind);
-        }
-    });
-
-    let d = args.duration;
-    task::spawn(async move {
-        task::sleep(Duration::from_secs(d)).await;
-        std::process::exit(0);
-    });
-
-    loop {
-        let now_q = Instant::now();
-        let mut replies = session
-            .query(
-                &reskey,
-                "",
-                net::QueryTarget::default(),
-                net::QueryConsolidation::default(),
-            )
-            .await
-            .unwrap();
-        while replies.next().await.is_some() {}
-        count.fetch_add(1, Ordering::AcqRel);
-        rtts.fetch_add(now_q.elapsed().as_micros() as u64, Ordering::AcqRel);
-    }
-}
diff --git a/zrpc-perf/src/bin/queryable.rs b/zrpc-perf/src/bin/queryable.rs
deleted file mode 100644
index 93c379d3..00000000
--- a/zrpc-perf/src/bin/queryable.rs
+++ /dev/null
@@ -1,74 +0,0 @@
-use async_std::task;
-use futures::prelude::*;
-use futures::select;
-use std::convert::TryFrom;
-use structopt::StructOpt;
-use zenoh::net::queryable::EVAL;
-use zenoh::net::*;
-use zenoh::*;
-use zenoh::net::protocol::proto::DataInfo;
-
-static DEFAULT_MODE: &str = "peer";
-static DEFAULT_SIZE: &str = "8";
-
-#[derive(StructOpt, Debug)]
-struct GetArgs {
-    /// Config file
-    #[structopt(short, long, default_value = DEFAULT_MODE)]
-    mode: String,
-    #[structopt(short, long)]
-    peer: Option<String>,
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-}
-
-#[async_std::main]
-async fn main() {
-    let args = GetArgs::from_args();
-
-    let _h = task::spawn(async move {
-        let properties = match args.peer {
-            Some(peer) => format!("mode={};peer={}", args.mode, peer),
-            None => format!("mode={}", args.mode),
-        };
-        let zproperties = Properties::from(properties);
-        let session = zenoh::net::open(zproperties.into()).await.unwrap();
-
-        let path = &Path::try_from("/test/eval").unwrap();
-
-        let mut queryable = session
-            .declare_queryable(&path.clone().into(), EVAL)
-            .await
-            .unwrap();
-        let data: Vec<u8> = vec![0; args.size as usize];
-
-        let sample = Sample {
-            res_name: "/test/eval".into(),
-            payload: data.into(),
-            data_info: Some(DataInfo {
-                source_id: None,
-                source_sn: None,
-                first_router_id: None,
-                first_router_sn: None,
-                timestamp: Some(uhlc::Timestamp::new(
-                    Default::default(),
-                    uhlc::ID::new(16, [1u8; uhlc::ID::MAX_SIZE]),
-                )),
-                kind: None,
-                encoding: None,
-            }),
-        };
-        loop {
-            select!(
-                query = queryable.stream().next().fuse() => {
-                    let q = query.unwrap();
-                    q
-                    .reply(sample.clone())
-                    .await;
-                }
-            );
-        }
-    });
-
-    futures::future::pending::<()>().await;
-}
diff --git a/zrpc-perf/src/bin/serialization.rs b/zrpc-perf/src/bin/serialization.rs
deleted file mode 100644
index 6a81cd22..00000000
--- a/zrpc-perf/src/bin/serialization.rs
+++ /dev/null
@@ -1,93 +0,0 @@
-#![allow(clippy::manual_async_fn)]
-#![allow(clippy::large_enum_variant)]
-#[macro_use]
-extern crate std;
-
-use async_std::sync::Arc;
-use async_std::task;
-use futures::prelude::*;
-use std::convert::TryFrom;
-use std::sync::atomic::{AtomicU64, Ordering};
-use std::time::{Duration, Instant};
-use structopt::StructOpt;
-use zenoh::*;
-
-use async_std::prelude::FutureExt;
-
-use std::str;
-use uuid::Uuid;
-use zrpc::zrpcresult::{ZRPCError, ZRPCResult};
-use znrpc_macros::{znservice};
-
-static DEFAULT_INT: &str = "5";
-static DEFAULT_SIZE: &str = "8";
-static DEFAULT_DURATION: &str = "60";
-
-#[derive(StructOpt, Debug)]
-struct CallArgs {
-    /// Config file
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-    #[structopt(short, long, default_value = DEFAULT_INT)]
-    interveal: u64,
-    #[structopt(short, long, default_value = DEFAULT_DURATION)]
-    duration: u64,
-}
-
-#[znservice(
-    timeout_s = 60,
-    prefix = "/test",
-    service_uuid = "00000000-0000-0000-0000-000000000001"
-)]
-pub trait Bench {
-    async fn bench(&self) -> Vec<u8>;
-}
-
-
-#[async_std::main]
-async fn main() {
-    // initiate logging
-    env_logger::init();
-
-    let args = CallArgs::from_args();
-    let rtts = Arc::new(AtomicU64::new(0));
-    let count: Arc<AtomicU64> = Arc::new(AtomicU64::new(0));
-
-    let kind = "ZNRPC-RESP-SER";
-
-    let c = count.clone();
-    let s = args.size;
-    let i = args.interveal;
-    let rt = rtts.clone();
-    println!("MSGS,SIZE,THR,INTERVEAL,RTT_US,KIND");
-    task::spawn(async move {
-        loop {
-            task::sleep(Duration::from_secs(i)).await;
-            let n = c.swap(0, Ordering::AcqRel);
-            let r = rt.swap(0, Ordering::AcqRel);
-            let msgs = n / i;
-            let thr = (n * s * 8) / i;
-            let rtt = if n == 0 { 0f64 } else { (r as f64) / (n as f64) } as f64;
-            println!("{},{},{},{},{},{}", msgs, s, thr, i, rtt, kind);
-        }
-    });
-
-    let d = args.duration;
-    task::spawn(async move {
-        task::sleep(Duration::from_secs(d)).await;
-        std::process::exit(0);
-    });
-
-
-    let data = vec![0; args.size as usize];
-    let resp = BenchResponse::Bench(data);
-
-    loop {
-        let now_q = Instant::now();
-        let _d = zrpc::serialize::serialize_response(&resp.clone()).unwrap();
-        count.fetch_add(1, Ordering::AcqRel);
-        rtts.fetch_add(now_q.elapsed().as_micros() as u64, Ordering::AcqRel);
-    }
-
-}
-
diff --git a/zrpc-perf/src/bin/sub_thr.rs b/zrpc-perf/src/bin/sub_thr.rs
deleted file mode 100644
index 015819fe..00000000
--- a/zrpc-perf/src/bin/sub_thr.rs
+++ /dev/null
@@ -1,76 +0,0 @@
-use async_std::sync::Arc;
-use async_std::task;
-use std::convert::TryFrom;
-use std::sync::atomic::{AtomicU64, Ordering};
-use std::time::Duration;
-use structopt::StructOpt;
-use zenoh::*;
-
-static DEFAULT_MODE: &str = "peer";
-static DEFAULT_SIZE: &str = "8";
-static DEFAULT_INT: &str = "5";
-static DEFAULT_DURATION: &str = "60";
-
-#[derive(StructOpt, Debug)]
-struct GetArgs {
-    /// Zenoh mode, client or peer
-    #[structopt(short, long, default_value = DEFAULT_MODE)]
-    mode: String,
-    #[structopt(short, long)]
-    peer: Option<String>,
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-    #[structopt(short, long, default_value = DEFAULT_INT)]
-    interveal: u64,
-    #[structopt(short, long, default_value = DEFAULT_DURATION)]
-    duration: u64,
-}
-
-#[async_std::main]
-async fn main() {
-    let args = GetArgs::from_args();
-    let count: Arc<AtomicU64> = Arc::new(AtomicU64::new(0));
-
-    //Fields are the same for each test,
-    // if they do not make sense they are set to 0
-    let properties = match args.peer {
-        Some(peer) => format!("mode={};peer={}", args.mode, peer),
-        None => format!("mode={}", args.mode),
-    };
-    let zproperties = Properties::from(properties);
-    let zenoh = Zenoh::new(zproperties.into()).await.unwrap();
-    let ws = zenoh.workspace(None).await.unwrap();
-
-    let path = Selector::try_from(format!("/test/thr")).unwrap();
-
-    let kind = if args.mode == "peer" {
-        "PP-SUB"
-    } else {
-        "CRC-SUB"
-    };
-    println!("MSGS,SIZE,THR,INTERVEAL,RTT_US,KIND");
-    let c = count.clone();
-    let s = args.size;
-    let i = args.interveal;
-    task::spawn(async move {
-        loop {
-            task::sleep(Duration::from_secs(i)).await;
-            let n = c.swap(0, Ordering::AcqRel);
-            let msgs = n / i;
-            let thr = (n * s * 8) / i;
-            println!("{},{},{},{},{},{}", msgs, s, thr, i, 0, kind);
-        }
-    });
-
-    let subscriber = ws
-        .subscribe_with_callback(&path, move |_change| {
-            count.fetch_add(1, Ordering::AcqRel);
-        })
-        .await
-        .unwrap();
-
-    task::sleep(Duration::from_secs(args.duration)).await;
-
-    subscriber.close().await.unwrap();
-    zenoh.close().await.unwrap();
-}
diff --git a/zrpc-perf/src/bin/write_thr.rs b/zrpc-perf/src/bin/write_thr.rs
deleted file mode 100644
index 22380d9e..00000000
--- a/zrpc-perf/src/bin/write_thr.rs
+++ /dev/null
@@ -1,57 +0,0 @@
-use structopt::StructOpt;
-use zenoh::net::*;
-use zenoh::Properties;
-
-static DEFAULT_MODE: &str = "peer";
-static DEFAULT_SIZE: &str = "8";
-
-#[derive(StructOpt, Debug)]
-struct WriteArgs {
-    /// Config file
-    #[structopt(short, long, default_value = DEFAULT_MODE)]
-    mode: String,
-    #[structopt(short, long)]
-    peer: Option<String>,
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-}
-
-#[async_std::main]
-async fn main() {
-    let args = WriteArgs::from_args();
-
-    //println!("Args {:?}", args);
-
-    let properties = match args.peer {
-        Some(peer) => format!("mode={};peer={}", args.mode, peer),
-        None => format!("mode={}", args.mode),
-    };
-    let zproperties = Properties::from(properties);
-    let session = zenoh::net::open(zproperties.into()).await.unwrap();
-
-    let reskey = ResKey::RId(
-        session
-            .declare_resource(&ResKey::RName(format!("/test/thr")))
-            .await
-            .unwrap(),
-    );
-    let _publ = session.declare_publisher(&reskey).await.unwrap();
-
-    let data: RBuf = (0usize..(args.size as usize))
-        .map(|_| 0 as u8)
-        .collect::<Vec<u8>>()
-        .into();
-
-    loop {
-        session
-            .write_ext(
-                &reskey,
-                data.clone(),
-                encoding::DEFAULT,
-                data_kind::DEFAULT,
-                CongestionControl::Block, // Make sure to not drop messages because of congestion control
-            )
-            .await
-            .unwrap();
-    }
-}
diff --git a/zrpc-perf/src/bin/zn_ping.rs b/zrpc-perf/src/bin/zn_ping.rs
deleted file mode 100644
index 69fe60b1..00000000
--- a/zrpc-perf/src/bin/zn_ping.rs
+++ /dev/null
@@ -1,161 +0,0 @@
-//
-// Copyright (c) 2017, 2020 ADLINK Technology Inc.
-//
-// This program and the accompanying materials are made available under the
-// terms of the Eclipse Public License 2.0 which is available at
-// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
-// which is available at https://www.apache.org/licenses/LICENSE-2.0.
-//
-// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
-//
-// Contributors:
-//   ADLINK zenoh team, <zenoh@adlink-labs.tech>
-//
-use async_std::stream::StreamExt;
-use async_std::sync::{Arc, Barrier, Mutex};
-use async_std::channel::{unbounded, Sender, Receiver};
-use async_std::task;
-use std::collections::HashMap;
-use std::time::{Duration, Instant};
-use zenoh::net::ResKey::*;
-use zenoh::net::*;
-use zenoh::Properties;
-use structopt::StructOpt;
-
-
-static DEFAULT_MODE: &str = "peer";
-static DEFAULT_SIZE: &str = "8";
-static DEFAULT_INT: &str = "1";
-static DEFAULT_DURATION: &str = "60";
-#[derive(StructOpt, Debug)]
-struct PingArgs {
-    /// Zenoh mode, client or peer
-    #[structopt(short, long, default_value = DEFAULT_MODE)]
-    mode: String,
-    #[structopt(short, long)]
-    peer: Option<String>,
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-    #[structopt(short, long, default_value = DEFAULT_INT)]
-    interveal: f64,
-    #[structopt(short, long, default_value = DEFAULT_DURATION)]
-    duration: u64,
-}
-
-type PingInfo = (u64,usize,u128);
-
-#[async_std::main]
-async fn main() {
-    // initiate logging
-    env_logger::init();
-
-    let args = PingArgs::from_args();
-
-    let scenario = if args.mode == "peer" {
-        "PP-PING"
-    } else {
-        "CRC-PING"
-    };
-
-    let properties = match args.peer {
-        Some(peer) => format!("mode={};peer={}", args.mode, peer),
-        None => format!("mode={}", args.mode),
-    };
-    let zproperties = Properties::from(properties);
-
-    let session = open(zproperties.into()).await.unwrap();
-    let session = Arc::new(session);
-
-
-    let (s,r) = unbounded::<PingInfo>();
-
-    // The hashmap with the pings
-    let pending = Arc::new(Mutex::new(HashMap::<u64, Instant>::new()));
-    let barrier = Arc::new(Barrier::new(2));
-
-    let c_pending = pending.clone();
-    let c_barrier = barrier.clone();
-    let c_session = session.clone();
-    task::spawn(async move {
-        // The resource to wait the response back
-        let reskey_pong = RId(c_session
-            .declare_resource(&RName("/test/pong".to_string()))
-            .await
-            .unwrap());
-
-        let sub_info = SubInfo {
-            reliability: Reliability::Reliable,
-            mode: SubMode::Push,
-            period: None,
-        };
-        let mut sub = c_session
-            .declare_subscriber(&reskey_pong, &sub_info)
-            .await
-            .unwrap();
-
-        // Wait for the both publishers and subscribers to be declared
-        c_barrier.wait().await;
-        println!("SQ_NUMBER,SIZE,RTT_US,SCENARIO");
-        while let Some(mut sample) = sub.stream().next().await {
-            let mut count_bytes = [0u8; 8];
-            sample.payload.read_bytes(&mut count_bytes);
-            let count = u64::from_le_bytes(count_bytes);
-            let instant = c_pending.lock().await.remove(&count).unwrap();
-            s.send((count,sample.payload.len(),instant.elapsed().as_micros())).await;
-            //print!("{},{},{},{}\n", count,sample.payload.len(),instant.elapsed().as_micros(),scenario);
-        }
-    });
-
-
-    task::spawn(async move {
-        loop {
-            while let Ok(pi) = r.recv().await {
-                let (c,s,rtt) = pi;
-                print!("{},{},{},{}\n", c,s,rtt,scenario);
-            }
-        }
-    });
-
-    let d = args.duration;
-    task::spawn(async move {
-         task::sleep(Duration::from_secs(d)).await;
-         std::process::exit(0);
-    });
-
-    // The resource to publish data on
-    let reskey_ping = RId(session
-        .declare_resource(&RName("/test/ping".to_string()))
-        .await
-        .unwrap());
-    let _publ = session.declare_publisher(&reskey_ping).await.unwrap();
-
-    // Wait for the both publishers and subscribers to be declared
-    barrier.wait().await;
-
-    let payload = vec![0u8; args.size as usize - 8];
-    let mut count: u64 = 0;
-    let i = args.interveal;
-    loop {
-        let mut data: WBuf = WBuf::new(args.size as usize, true);
-        let count_bytes: [u8; 8] = count.to_le_bytes();
-        data.write_bytes(&count_bytes);
-        data.write_bytes(&payload);
-
-        let data: RBuf = data.into();
-
-        pending.lock().await.insert(count, Instant::now());
-        session
-            .write_ext(
-                &reskey_ping,
-                data,
-                encoding::DEFAULT,
-                data_kind::DEFAULT,
-                CongestionControl::Block, // Make sure to not drop messages because of congestion control
-            )
-            .await
-            .unwrap();
-
-        task::sleep(Duration::from_secs_f64(i)).await;
-        count += 1;
-    }
-}
\ No newline at end of file
diff --git a/zrpc-perf/src/bin/zn_pong.rs b/zrpc-perf/src/bin/zn_pong.rs
deleted file mode 100644
index f3b9c567..00000000
--- a/zrpc-perf/src/bin/zn_pong.rs
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// Copyright (c) 2017, 2020 ADLINK Technology Inc.
-//
-// This program and the accompanying materials are made available under the
-// terms of the Eclipse Public License 2.0 which is available at
-// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
-// which is available at https://www.apache.org/licenses/LICENSE-2.0.
-//
-// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
-//
-// Contributors:
-//   ADLINK zenoh team, <zenoh@adlink-labs.tech>
-//
-use async_std::future;
-use async_std::stream::StreamExt;
-use clap::{App, Arg};
-use zenoh::net::ResKey::*;
-use zenoh::net::*;
-use zenoh::Properties;
-
-#[async_std::main]
-async fn main() {
-    // initiate logging
-    env_logger::init();
-
-    let config = parse_args();
-
-    let session = open(config.into()).await.unwrap();
-
-    // The resource to echo the data back
-    let reskey_pong = RId(session
-        .declare_resource(&RName("/test/pong".to_string()))
-        .await
-        .unwrap());
-    let _publ = session.declare_publisher(&reskey_pong).await.unwrap();
-
-    // The resource to read the data from
-    let reskey_ping = RId(session
-        .declare_resource(&RName("/test/ping".to_string()))
-        .await
-        .unwrap());
-    let sub_info = SubInfo {
-        reliability: Reliability::Reliable,
-        mode: SubMode::Push,
-        period: None,
-    };
-
-    let mut sub = session
-        .declare_subscriber(&reskey_ping, &sub_info)
-        .await
-        .unwrap();
-    while let Some(sample) = sub.stream().next().await {
-        session
-            .write_ext(
-                &reskey_pong,
-                sample.payload,
-                encoding::DEFAULT,
-                data_kind::DEFAULT,
-                CongestionControl::Block, // Make sure to not drop messages because of congestion control
-            )
-            .await
-            .unwrap();
-    }
-
-    // Stop forever
-    future::pending::<()>().await;
-}
-
-fn parse_args() -> Properties {
-    let args = App::new("zenoh-net delay sub example")
-        .arg(
-            Arg::from_usage("-m, --mode=[MODE]  'The zenoh session mode.")
-                .possible_values(&["peer", "client"])
-                .default_value("peer"),
-        )
-        .arg(Arg::from_usage(
-            "-e, --peer=[LOCATOR]...   'Peer locators used to initiate the zenoh session.'",
-        ))
-        .arg(Arg::from_usage(
-            "-l, --listener=[LOCATOR]...   'Locators to listen on.'",
-        ))
-        .arg(Arg::from_usage(
-            "--no-multicast-scouting 'Disable the multicast-based scouting mechanism.'",
-        ))
-        .get_matches();
-
-    let mut config = Properties::default();
-    for key in ["mode", "peer", "listener"].iter() {
-        if let Some(value) = args.values_of(key) {
-            config.insert(key.to_string(), value.collect::<Vec<&str>>().join(","));
-        }
-    }
-    if args.is_present("no-multicast-scouting") {
-        config.insert("multicast_scouting".to_string(), "false".to_string());
-    }
-
-    config
-}
diff --git a/zrpc-perf/src/bin/znrpc_call.rs b/zrpc-perf/src/bin/znrpc_call.rs
deleted file mode 100644
index 61bae64c..00000000
--- a/zrpc-perf/src/bin/znrpc_call.rs
+++ /dev/null
@@ -1,172 +0,0 @@
-#![allow(clippy::manual_async_fn)]
-#![allow(clippy::large_enum_variant)]
-#[macro_use]
-extern crate std;
-
-use async_std::sync::Arc;
-use async_std::task;
-use futures::prelude::*;
-use std::convert::TryFrom;
-use std::sync::atomic::{AtomicU64, Ordering};
-use std::time::{Duration, Instant};
-use structopt::StructOpt;
-use zenoh::*;
-
-use async_std::prelude::FutureExt;
-
-use std::str;
-use uuid::Uuid;
-use zrpc::ZNServe;
-use zrpc::zrpcresult::{ZRPCError, ZRPCResult};
-use znrpc_macros::{znserver, znservice};
-
-static DEFAULT_MODE: &str = "client";
-static DEFAULT_ZMODE: &str = "peer";
-static DEFAULT_ROUTER: &str = "tcp/127.0.0.1:7447";
-static DEFAULT_INT: &str = "5";
-static DEFAULT_SIZE: &str = "8";
-static DEFAULT_DURATION: &str = "60";
-
-#[derive(StructOpt, Debug)]
-struct CallArgs {
-    /// Config file
-    #[structopt(short, long, default_value = DEFAULT_MODE)]
-    mode: String,
-    #[structopt(short, long, default_value = DEFAULT_ZMODE)]
-    zenoh_mode: String,
-    #[structopt(short, long, default_value = DEFAULT_ROUTER)]
-    router: String,
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-    #[structopt(short, long, default_value = DEFAULT_INT)]
-    interveal: u64,
-    #[structopt(short, long, default_value = DEFAULT_DURATION)]
-    duration: u64,
-}
-
-#[znservice(
-    timeout_s = 60,
-    prefix = "/test",
-    service_uuid = "00000000-0000-0000-0000-000000000001"
-)]
-pub trait Bench {
-    async fn bench(&self) -> Vec<u8>;
-}
-
-#[derive(Clone)]
-struct BenchZService {
-    pub data: Vec<u8>,
-}
-
-#[znserver]
-impl Bench for BenchZService {
-    async fn bench(&self) -> Vec<u8> {
-        self.data.clone()
-    }
-}
-
-#[async_std::main]
-async fn main() {
-    // initiate logging
-    env_logger::init();
-
-    let args = CallArgs::from_args();
-
-    if args.mode == "server" {
-        server(args).await;
-    } else if args.mode == "client" {
-        client(args).await;
-    } else {
-        panic!("Mode can be only one of [client|server]")
-    }
-}
-
-async fn client(args: CallArgs) {
-    let rtts = Arc::new(AtomicU64::new(0));
-    let count: Arc<AtomicU64> = Arc::new(AtomicU64::new(0));
-
-    let properties = if args.zenoh_mode == "peer" {
-        format!("mode={}", args.zenoh_mode)
-    } else {
-        format!("mode={};peer={}", args.zenoh_mode, args.router)
-    };
-
-    let zproperties = Properties::from(properties);
-    let zenoh = Arc::new(zenoh::net::open(zproperties.clone().into()).await.unwrap());
-
-    task::sleep(std::time::Duration::from_secs(1)).await;
-
-    let info: zenoh::Properties = zenoh.info().await.into();
-    for (key, value) in info.iter() {
-        log::trace!("{} : {}", key, value);
-    }
-
-    let local_servers = BenchClient::find_servers(zenoh.clone())
-        .await
-        .unwrap();
-    log::trace!("Servers: {:?}", local_servers);
-
-    let client = BenchClient::new(zenoh.clone(), local_servers[0]);
-
-    let kind = if args.zenoh_mode == "client" {
-        "CRC-ZNRPC"
-    } else {
-        "PP-ZNRPC"
-    };
-
-    let c = count.clone();
-    let s = args.size;
-    let i = args.interveal;
-    let rt = rtts.clone();
-    println!("MSGS,SIZE,THR,INTERVEAL,RTT_US,KIND");
-    task::spawn(async move {
-        loop {
-            task::sleep(Duration::from_secs(i)).await;
-            let n = c.swap(0, Ordering::AcqRel);
-            let r = rt.swap(0, Ordering::AcqRel);
-            let msgs = n / i;
-            let thr = (n * s * 8) / i;
-            let rtt = if n == 0 { 0 } else { r / n };
-            println!("{},{},{},{},{},{}", msgs, s, thr, i, rtt, kind);
-        }
-    });
-
-    let start = Instant::now();
-
-
-     while start.elapsed() < Duration::from_secs(args.duration) {
-            let now_q = Instant::now();
-            let _r = client.bench().await;
-            count.fetch_add(1, Ordering::AcqRel);
-            rtts.fetch_add(now_q.elapsed().as_micros() as u64, Ordering::AcqRel);
-    }
-
-
-    //zenoh.close().await.unwrap();
-}
-
-async fn server(args: CallArgs) {
-
-    let properties = if args.zenoh_mode == "peer" {
-        format!("mode={}", args.zenoh_mode)
-    } else {
-        format!("mode={};peer={}", args.zenoh_mode, args.router)
-    };
-
-    let zproperties = Properties::from(properties);
-    let zenoh = Arc::new(zenoh::net::open(zproperties.clone().into()).await.unwrap());
-
-    let data = vec![0; args.size as usize];
-
-    let service = BenchZService { data };
-
-    let server = service.get_bench_server(zenoh.clone(), None);
-
-    println!("Instance ID {}", server.instance_uuid());
-    let (_ss, _h) = server.connect().await.unwrap();
-    server.initialize().await.unwrap();
-    server.register().await.unwrap();
-    let (_s, handle) = server.start().await.unwrap();
-
-    handle.await.unwrap();
-}
diff --git a/zrpc-perf/src/bin/zrpc_call.rs b/zrpc-perf/src/bin/zrpc_call.rs
deleted file mode 100644
index bd936763..00000000
--- a/zrpc-perf/src/bin/zrpc_call.rs
+++ /dev/null
@@ -1,181 +0,0 @@
-#![allow(clippy::manual_async_fn)]
-#![allow(clippy::large_enum_variant)]
-#[macro_use]
-extern crate std;
-
-use async_std::sync::Arc;
-use async_std::task;
-use futures::prelude::*;
-use std::convert::TryFrom;
-use std::sync::atomic::{AtomicU64, Ordering};
-use std::time::{Duration, Instant};
-use structopt::StructOpt;
-use zenoh::*;
-
-use async_std::prelude::FutureExt;
-
-use std::str;
-use uuid::Uuid;
-use zrpc::ZServe;
-//importing the macros
-use zrpc::zrpcresult::{ZRPCError, ZRPCResult};
-use zrpc_macros::{zserver, zservice};
-
-static DEFAULT_MODE: &str = "client";
-static DEFAULT_ZMODE: &str = "client";
-static DEFAULT_ROUTER: &str = "tcp/127.0.0.1:7447";
-static DEFAULT_INT: &str = "5";
-static DEFAULT_SIZE: &str = "8";
-static DEFAULT_DURATION: &str = "60";
-
-#[derive(StructOpt, Debug)]
-struct CallArgs {
-    /// Config file
-    #[structopt(short, long, default_value = DEFAULT_MODE)]
-    mode: String,
-    #[structopt(short, long, default_value = DEFAULT_ZMODE)]
-    zenoh_mode: String,
-    #[structopt(short, long, default_value = DEFAULT_ROUTER)]
-    router: String,
-    #[structopt(short, long, default_value = DEFAULT_SIZE)]
-    size: u64,
-    #[structopt(short, long, default_value = DEFAULT_INT)]
-    interveal: u64,
-    #[structopt(short, long, default_value = DEFAULT_DURATION)]
-    duration: u64,
-    #[structopt(short, long)]
-    nocheck: bool,
-}
-
-#[zservice(
-    timeout_s = 60,
-    prefix = "/test",
-    service_uuid = "00000000-0000-0000-0000-000000000001"
-)]
-pub trait Bench {
-    async fn bench(&self) -> Vec<u8>;
-}
-
-#[derive(Clone)]
-struct BenchZService {
-    pub data: Vec<u8>,
-}
-
-#[zserver]
-impl Bench for BenchZService {
-    async fn bench(&self) -> Vec<u8> {
-        self.data.clone()
-    }
-}
-
-#[async_std::main]
-async fn main() {
-    // initiate logging
-    env_logger::init();
-
-    let args = CallArgs::from_args();
-
-    if args.mode == "server" {
-        server(args).await;
-    } else if args.mode == "client" {
-        client(args).await;
-    } else {
-        panic!("Mode can be only one of [client|server]")
-    }
-}
-
-async fn client(args: CallArgs) {
-    let rtts = Arc::new(AtomicU64::new(0));
-    let count: Arc<AtomicU64> = Arc::new(AtomicU64::new(0));
-
-    let properties = if args.zenoh_mode == "peer" {
-        format!("mode={}", args.zenoh_mode)
-    } else {
-        format!("mode={};peer={}", args.zenoh_mode, args.router)
-    };
-
-    let zproperties = Properties::from(properties);
-    let zenoh = Arc::new(Zenoh::new(zproperties.into()).await.unwrap());
-
-    let local_servers = BenchClient::find_local_servers(zenoh.clone())
-        .await
-        .unwrap();
-    log::trace!("Local servers: {:?}", local_servers);
-
-    let client = BenchClient::new(zenoh.clone(), local_servers[0]);
-
-    let kind = if !args.nocheck {
-        if args.zenoh_mode == "client" {
-            "CRC-ZRPC"
-        } else {
-            "PP-ZRPC"
-        }
-    } else {
-        if args.zenoh_mode == "client" {
-            "CRC-ZRPC-NOCHK"
-        } else {
-            "PP-ZRPC-NOCHK"
-        }
-    };
-
-    let c = count.clone();
-    let s = args.size;
-    let i = args.interveal;
-    let rt = rtts.clone();
-    println!("MSGS,SIZE,THR,INTERVEAL,RTT_US,KIND");
-    task::spawn(async move {
-        loop {
-            task::sleep(Duration::from_secs(i)).await;
-            let n = c.swap(0, Ordering::AcqRel);
-            let r = rt.swap(0, Ordering::AcqRel);
-            let msgs = n / i;
-            let thr = (n * s * 8) / i;
-            let rtt = if n == 0 { 0 } else { r / n };
-            println!("{},{},{},{},{},{}", msgs, s, thr, i, rtt, kind);
-        }
-    });
-
-    let start = Instant::now();
-
-    if !args.nocheck {
-        while start.elapsed() < Duration::from_secs(args.duration) {
-            let now_q = Instant::now();
-            let _r = client.bench().await;
-            count.fetch_add(1, Ordering::AcqRel);
-            rtts.fetch_add(now_q.elapsed().as_micros() as u64, Ordering::AcqRel);
-        }
-    } else {
-        while start.elapsed() < Duration::from_secs(args.duration) {
-            let now_q = Instant::now();
-            let _r = client.bench_nochk().await;
-            count.fetch_add(1, Ordering::AcqRel);
-            rtts.fetch_add(now_q.elapsed().as_micros() as u64, Ordering::AcqRel);
-        }
-    }
-
-    //zenoh.close().await.unwrap();
-}
-
-async fn server(args: CallArgs) {
-    let properties = if args.zenoh_mode == "peer" {
-        format!("mode={}", args.zenoh_mode)
-    } else {
-        format!("mode={};peer={}", args.zenoh_mode, args.router)
-    };
-    let zproperties = Properties::from(properties);
-    let zenoh = Arc::new(Zenoh::new(zproperties.into()).await.unwrap());
-
-    let data = vec![0; args.size as usize];
-
-    let service = BenchZService { data };
-
-    let server = service.get_bench_server(zenoh.clone(), None);
-
-    println!("Instance ID {}", server.instance_uuid());
-    server.connect().await.unwrap();
-    server.initialize().await.unwrap();
-    server.register().await.unwrap();
-    let (_s, handle) = server.start().await.unwrap();
-
-    handle.await.unwrap();
-}
diff --git a/zrpc-perf/src/bin/zrpc_get_zenoh.rs b/zrpc-perf/src/bin/zrpc_get_zenoh.rs
deleted file mode 100644
index c25f9649..00000000
--- a/zrpc-perf/src/bin/zrpc_get_zenoh.rs
+++ /dev/null
@@ -1,81 +0,0 @@
-use async_std::sync::Arc;
-use async_std::task;
-use futures::prelude::*;
-use std::convert::TryFrom;
-use std::sync::atomic::{AtomicU64, Ordering};
-use std::time::{Duration, Instant};
-use structopt::StructOpt;
-use zenoh::*;
-
-static DEFAULT_MODE: &str = "peer";
-static DEFAULT_INT: &str = "5";
-static DEFAULT_DURATION: &str = "60";
-
-#[derive(StructOpt, Debug)]
-struct GetArgs {
-    /// Config file
-    #[structopt(short, long, default_value = DEFAULT_MODE)]
-    mode: String,
-    #[structopt(short, long)]
-    peer: Option<String>,
-    #[structopt(short, long, default_value = DEFAULT_INT)]
-    interveal: u64,
-    #[structopt(short, long, default_value = DEFAULT_DURATION)]
-    duration: u64,
-}
-
-#[async_std::main]
-async fn main() {
-    let args = GetArgs::from_args();
-
-    let rtts = Arc::new(AtomicU64::new(0));
-    let count: Arc<AtomicU64> = Arc::new(AtomicU64::new(0));
-
-    println!("MSGS,SIZE,THR,INTERVEAL,RTT_US,KIND");
-    let properties = match args.peer {
-        Some(peer) => format!("mode={};peer={}", args.mode, peer),
-        None => format!("mode={}", args.mode),
-    };
-    let zproperties = Properties::from(properties);
-    let zenoh = Zenoh::new(zproperties.into()).await.unwrap();
-    let ws = zenoh.workspace(None).await.unwrap();
-
-    let zsession = zenoh.session();
-    let zinfo = zsession.info().await;
-    let rid = zinfo
-        .get(&zenoh::net::info::ZN_INFO_ROUTER_PID_KEY)
-        .unwrap()
-        .split(",")
-        .collect::<Vec<_>>()[0]
-        .to_uppercase();
-
-    let selector = zenoh::Selector::try_from(format!("/@/router/{}", String::from(&rid))).unwrap();
-
-    let c = count.clone();
-    let s = 491;
-    let i = args.interveal;
-    let rt = rtts.clone();
-    task::spawn(async move {
-        loop {
-            task::sleep(Duration::from_secs(i)).await;
-            let n = c.swap(0, Ordering::AcqRel);
-            let r = rt.swap(0, Ordering::AcqRel);
-            let msgs = n / i;
-            let thr = (n * s * 8) / i;
-            let rtt = r / n;
-            println!("{},{},{},{},{},{}", msgs, s, thr, i, rtt, "ZRPC-Z-ADMIN");
-        }
-    });
-
-    let start = Instant::now();
-
-    while start.elapsed() < Duration::from_secs(args.duration) {
-        let now_q = Instant::now();
-        let mut data_stream = ws.get(&selector).await.unwrap();
-        while data_stream.next().await.is_some() {}
-        count.fetch_add(1, Ordering::AcqRel);
-        rtts.fetch_add(now_q.elapsed().as_micros() as u64, Ordering::AcqRel);
-    }
-
-    zenoh.close().await.unwrap();
-}
diff --git a/zrpc-perf/src/bin/zrpc_state.rs b/zrpc-perf/src/bin/zrpc_state.rs
deleted file mode 100644
index 9a97cbf5..00000000
--- a/zrpc-perf/src/bin/zrpc_state.rs
+++ /dev/null
@@ -1,146 +0,0 @@
-#![allow(clippy::manual_async_fn)]
-#![allow(clippy::large_enum_variant)]
-#[macro_use]
-extern crate std;
-
-use async_std::sync::Arc;
-use async_std::task;
-use futures::prelude::*;
-use std::convert::TryFrom;
-use std::sync::atomic::{AtomicU64, Ordering};
-use std::time::{Duration, Instant};
-use structopt::StructOpt;
-use zenoh::*;
-
-use async_std::prelude::FutureExt;
-
-use std::str;
-use uuid::Uuid;
-use zrpc::ZServe;
-//importing the macros
-use zrpc::zrpcresult::{ZRPCError, ZRPCResult};
-use zrpc_macros::{zserver, zservice};
-
-static DEFAULT_MODE: &str = "client";
-static DEFAULT_ROUTER: &str = "tcp/127.0.0.1:7447";
-static DEFAULT_INT: &str = "5";
-static DEFAULT_DURATION: &str = "60";
-
-#[derive(StructOpt, Debug)]
-struct CallArgs {
-    /// Config file
-    #[structopt(short, long, default_value = DEFAULT_MODE)]
-    mode: String,
-    #[structopt(short, long, default_value = DEFAULT_ROUTER)]
-    router: String,
-    #[structopt(short, long, default_value = DEFAULT_INT)]
-    interveal: u64,
-    #[structopt(short, long, default_value = DEFAULT_DURATION)]
-    duration: u64,
-}
-
-#[zservice(
-    timeout_s = 60,
-    prefix = "/lfos",
-    service_uuid = "00000000-0000-0000-0000-000000000001"
-)]
-pub trait Bench {
-    async fn bench(&self, name: String) -> String;
-}
-
-#[derive(Clone)]
-struct BenchZService {
-    pub ser_name: String,
-}
-
-#[zserver]
-impl Bench for BenchZService {
-    async fn bench(&self, name: String) -> String {
-        format!("Hello {}!, you are connected to {}", name, self.ser_name)
-    }
-}
-
-#[async_std::main]
-async fn main() {
-    // initiate logging
-    env_logger::init();
-
-    let args = CallArgs::from_args();
-
-    if args.mode == "server" {
-        server(args).await;
-    } else if args.mode == "client" {
-        client(args).await;
-    } else {
-        panic!("Mode can be only one of [client|server]")
-    }
-}
-
-async fn client(args: CallArgs) {
-    let rtts = Arc::new(AtomicU64::new(0));
-    let count: Arc<AtomicU64> = Arc::new(AtomicU64::new(0));
-
-    println!("MSGS,SIZE,THR,INTERVEAL,RTT_US,KIND");
-    let properties = format!("mode=client;peer={}", args.router);
-
-    let zproperties = Properties::from(properties);
-    let zenoh = Arc::new(Zenoh::new(zproperties.into()).await.unwrap());
-
-    //let ws = zenoh.workspace(None).await.unwrap();
-
-    let local_servers = BenchClient::find_local_servers(zenoh.clone())
-        .await
-        .unwrap();
-    //println!("local_servers: {:?}", local_servers);
-
-    let client = BenchClient::new(zenoh.clone(), local_servers[0]);
-    // let path = Selector::try_from(format!("/test/{}", args.size)).unwrap() ;
-
-    let c = count.clone();
-    let s = 128;
-    let i = args.interveal;
-    let rt = rtts.clone();
-    task::spawn(async move {
-        loop {
-            task::sleep(Duration::from_secs(i)).await;
-            let n = c.swap(0, Ordering::AcqRel);
-            let r = rt.swap(0, Ordering::AcqRel);
-            let msgs = n / i;
-            let thr = (n * s * 8) / i;
-            let rtt = if n > 0 { r / n } else { std::u64::MAX };
-            println!("{},{},{},{},{},{}", msgs, s, thr, i, rtt, "ZRPC-STATE");
-        }
-    });
-
-    let start = Instant::now();
-
-    while start.elapsed() < Duration::from_secs(args.duration) {
-        let now_q = Instant::now();
-        client.verify_server().await.unwrap();
-        count.fetch_add(1, Ordering::AcqRel);
-        rtts.fetch_add(now_q.elapsed().as_micros() as u64, Ordering::AcqRel);
-    }
-
-    //zenoh.close().await.unwrap();
-}
-
-async fn server(args: CallArgs) {
-    let properties = format!("mode=client;peer={}", args.router);
-    let zproperties = Properties::from(properties);
-    let zenoh = Arc::new(Zenoh::new(zproperties.into()).await.unwrap());
-
-    let service = BenchZService {
-        ser_name: "bench service".to_string(),
-    };
-
-    let server = service.get_bench_server(zenoh.clone(), None);
-
-    println!("Instance ID {}", server.instance_uuid());
-    server.connect().await.unwrap();
-    server.initialize().await.unwrap();
-    server.register().await.unwrap();
-
-    let (_s, handle) = server.start().await.unwrap();
-
-    handle.await.unwrap();
-}
diff --git a/zrpc-perf/src/lib.rs b/zrpc-perf/src/lib.rs
deleted file mode 100644
index 4ed4e7f4..00000000
--- a/zrpc-perf/src/lib.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-/*********************************************************************************
-* Copyright (c) 2018,2020 ADLINK Technology Inc.
-*
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License 2.0 which is available at
-* http://www.eclipse.org/legal/epl-2.0, or the Apache Software License 2.0
-* which is available at https://www.apache.org/licenses/LICENSE-2.0.
-*
-* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
-* Contributors:
-*   ADLINK fog05 team, <fog05@adlink-labs.tech>
-*********************************************************************************/
diff --git a/zrpc/Cargo.toml b/zrpc/Cargo.toml
deleted file mode 100644
index 57872309..00000000
--- a/zrpc/Cargo.toml
+++ /dev/null
@@ -1,45 +0,0 @@
-[package]
-name = "zrpc"
-version = "0.3.0-alpha1"
-authors = ["gabrik <gabriele.baldoni@gmail.com>"]
-edition = "2018"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
-async-std = { version = "=1.9.0", features = ["attributes"] }
-futures = "0.3.5"
-zenoh = { git = "https://github.com/eclipse-zenoh/zenoh.git", rev = "cf124d6c4d393e65662d1e1caf567b66af7150d5" }
-uuid = { version = "0.8.1", features = ["serde", "v4"] }
-base64 = "0.13.0"
-serde_derive = "1.0.55"
-serde = { version = "1.0.55", features = ["derive"] }
-thiserror = "1.0"
-log = "0.4"
-bincode = { version = "1.3.1", optional = true}
-serde_yaml = {version = "0.8.13", optional = true}
-serde_cbor = {version = "0.11.1", optional = true}
-serde_json = { version = "1.0.55", optional = true}
-
-[features]
-resp_bincode = ["bincode"]
-send_bincode = ["bincode"]
-
-send_json = ["serde_json"]
-resp_json = ["serde_json"]
-
-resp_cbor = ["serde_cbor"]
-send_cbor = ["serde_cbor"]
-
-state_bincode = ["bincode"]
-state_json = ["serde_json"]
-state_cbor = ["serde_cbor"]
-
-router_json = ["serde_json"]
-
-default = ["resp_cbor","send_cbor","state_cbor","router_json"]
-
-
-
-
-
diff --git a/zrpc/src/lib.rs b/zrpc/src/lib.rs
deleted file mode 100644
index 065001c9..00000000
--- a/zrpc/src/lib.rs
+++ /dev/null
@@ -1,176 +0,0 @@
-/*********************************************************************************
-* Copyright (c) 2018,2020 ADLINK Technology Inc.
-*
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License 2.0 which is available at
-* http://www.eclipse.org/legal/epl-2.0, or the Apache Software License 2.0
-* which is available at https://www.apache.org/licenses/LICENSE-2.0.
-*
-* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
-* Contributors:
-*   ADLINK fog05 team, <fog05@adlink-labs.tech>
-*********************************************************************************/
-#![feature(associated_type_bounds)]
-#![allow(clippy::upper_case_acronyms)]
-
-pub mod zchannel;
-pub use zchannel::ZClientChannel;
-
-pub mod znchannel;
-pub use znchannel::ZNClientChannel;
-
-pub mod types;
-pub use types::*;
-
-pub mod serialize;
-pub mod zrpcresult;
-
-use zrpcresult::ZRPCResult;
-/// Trait to be implemented by services
-pub trait ZServe<Req>: Sized + Clone {
-    /// Type of the response
-    type Resp;
-
-    fn instance_uuid(&self) -> uuid::Uuid;
-
-    /// Connects to Zenoh, do nothing in this case, state is HALTED
-    #[allow(clippy::type_complexity)]
-    fn connect(
-        &self,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>>;
-
-    /// Authenticates to Zenoh, state changes to INITIALIZING
-    #[allow(clippy::type_complexity)]
-    fn initialize(
-        &self,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>>;
-
-    // Registers, state changes to REGISTERED
-    #[allow(clippy::type_complexity)]
-    fn register(
-        &self,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>>;
-
-    // // Announce, state changes to ANNOUNCED
-    // //fn announce(&self);
-
-    /// State changes to SERVING, calls serve on a task::spawn, returns a stop sender and the serve task handle
-    #[allow(clippy::type_complexity)]
-    fn start(
-        &self,
-    ) -> ::core::pin::Pin<
-        Box<
-            dyn std::future::Future<
-                    Output = ZRPCResult<(
-                        async_std::channel::Sender<()>,
-                        async_std::task::JoinHandle<ZRPCResult<()>>,
-                    )>,
-                > + '_,
-        >,
-    >;
-
-    /// Starts serving all requests
-    #[allow(clippy::type_complexity)]
-    fn serve(
-        &self,
-        stop: async_std::channel::Receiver<()>,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>>;
-
-    /// State changes to REGISTERED, will stop serve/work
-    #[allow(clippy::type_complexity)]
-    fn stop(
-        &self,
-        stop: async_std::channel::Sender<()>,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>>;
-
-    // state changes to HALTED
-    #[allow(clippy::type_complexity)]
-    fn unregister(
-        &self,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>>;
-
-    /// removes state from Zenoh
-    #[allow(clippy::type_complexity)]
-    fn disconnect(self) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>>>>;
-}
-
-/// Trait to be implemented by services
-pub trait ZNServe<Req>: Sized + Clone {
-    /// Type of the response
-    type Resp;
-
-    fn instance_uuid(&self) -> uuid::Uuid;
-
-    /// Connects to Zenoh, do nothing in this case, state is HALTED
-    #[allow(clippy::type_complexity)]
-    fn connect(
-        &self,
-    ) -> ::core::pin::Pin<
-        Box<
-            dyn std::future::Future<
-                    Output = ZRPCResult<(
-                        async_std::channel::Sender<()>,
-                        async_std::task::JoinHandle<ZRPCResult<()>>,
-                    )>,
-                > + '_,
-        >,
-    >;
-
-    /// Authenticates to Zenoh, state changes to INITIALIZING
-    #[allow(clippy::type_complexity)]
-    fn initialize(
-        &self,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>>;
-
-    // Registers, state changes to REGISTERED
-    #[allow(clippy::type_complexity)]
-    fn register(
-        &self,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>>;
-
-    // // // Announce, state changes to ANNOUNCED
-    // // //fn announce(&self);
-
-    /// State changes to SERVING, calls serve on a task::spawn, returns a stop sender and the serve task handle
-    #[allow(clippy::type_complexity)]
-    fn start(
-        &self,
-    ) -> ::core::pin::Pin<
-        Box<
-            dyn std::future::Future<
-                    Output = ZRPCResult<(
-                        async_std::channel::Sender<()>,
-                        async_std::task::JoinHandle<ZRPCResult<()>>,
-                    )>,
-                > + '_,
-        >,
-    >;
-
-    /// Starts serving all requests
-    #[allow(clippy::type_complexity)]
-    fn serve(
-        &self,
-        stop: async_std::channel::Receiver<()>,
-        barrier: async_std::sync::Arc<async_std::sync::Barrier>,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>>;
-
-    /// State changes to REGISTERED, will stop serve/work
-    #[allow(clippy::type_complexity)]
-    fn stop(
-        &self,
-        stop: async_std::channel::Sender<()>,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>>;
-
-    // state changes to HALTED
-    #[allow(clippy::type_complexity)]
-    fn unregister(
-        &self,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>>;
-
-    /// removes state from Zenoh
-    #[allow(clippy::type_complexity)]
-    fn disconnect(
-        &self,
-        stop: async_std::channel::Sender<()>,
-    ) -> ::core::pin::Pin<Box<dyn std::future::Future<Output = ZRPCResult<()>> + '_>>;
-}
diff --git a/zrpc/src/serialize.rs b/zrpc/src/serialize.rs
deleted file mode 100644
index 3cd18242..00000000
--- a/zrpc/src/serialize.rs
+++ /dev/null
@@ -1,150 +0,0 @@
-/*********************************************************************************
-* Copyright (c) 2018,2020 ADLINK Technology Inc.
-*
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License 2.0 which is available at
-* http://www.eclipse.org/legal/epl-2.0, or the Apache Software License 2.0
-* which is available at https://www.apache.org/licenses/LICENSE-2.0.
-*
-* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
-* Contributors:
-*   ADLINK fog05 team, <fog05@adlink-labs.tech>
-*********************************************************************************/
-
-extern crate serde;
-
-#[cfg(any(
-    feature = "resp_bincode",
-    feature = "state_bincode",
-    feature = "send_bincode"
-))]
-extern crate bincode;
-
-#[cfg(any(feature = "resp_cbor", feature = "state_cbor", feature = "send_cbor"))]
-extern crate serde_cbor;
-
-#[cfg(any(feature = "send_json", feature = "state_json", feature = "resp_json"))]
-extern crate serde_json;
-
-use serde::{de::DeserializeOwned, Serialize};
-
-use crate::types::ZRouterInfo;
-use crate::zrpcresult::ZRPCResult;
-
-#[cfg(feature = "resp_bincode")]
-pub fn serialize_response<T: ?Sized>(data: &T) -> ZRPCResult<Vec<u8>>
-where
-    T: Serialize,
-{
-    Ok(bincode::serialize(data)?)
-}
-
-#[cfg(feature = "resp_json")]
-pub fn serialize_response<T: ?Sized>(data: &T) -> ZRPCResult<Vec<u8>>
-where
-    T: Serialize,
-{
-    Ok(serde_json::to_string(data)?.into_bytes())
-}
-
-#[cfg(feature = "resp_cbor")]
-pub fn serialize_response<T>(data: &T) -> ZRPCResult<Vec<u8>>
-where
-    T: Serialize,
-{
-    Ok(serde_cbor::to_vec(data)?)
-}
-
-pub fn deserialize_response<T>(raw_data: &[u8]) -> ZRPCResult<T>
-where
-    T: DeserializeOwned,
-{
-    #[cfg(feature = "resp_bincode")]
-    return Ok(bincode::deserialize::<T>(&raw_data)?);
-
-    #[cfg(feature = "resp_cbor")]
-    return Ok(serde_cbor::from_slice::<T>(&raw_data)?);
-
-    #[cfg(feature = "resp_json")]
-    return Ok(serde_json::from_str::<T>(std::str::from_utf8(raw_data)?)?);
-}
-
-#[cfg(feature = "state_bincode")]
-pub fn serialize_state<T: ?Sized>(data: &T) -> ZRPCResult<Vec<u8>>
-where
-    T: Serialize,
-{
-    Ok(bincode::serialize(data)?)
-}
-
-#[cfg(feature = "state_cbor")]
-pub fn serialize_state<T>(data: &T) -> ZRPCResult<Vec<u8>>
-where
-    T: Serialize,
-{
-    Ok(serde_cbor::to_vec(data)?)
-}
-
-#[cfg(feature = "state_json")]
-pub fn serialize_state<T: ?Sized>(data: &T) -> ZRPCResult<Vec<u8>>
-where
-    T: Serialize,
-{
-    Ok(serde_json::to_string(data)?.into_bytes())
-}
-
-pub fn deserialize_state<T>(raw_data: &[u8]) -> ZRPCResult<T>
-where
-    T: DeserializeOwned,
-{
-    #[cfg(feature = "state_bincode")]
-    return Ok(bincode::deserialize::<T>(&raw_data)?);
-
-    #[cfg(feature = "state_cbor")]
-    return Ok(serde_cbor::from_slice::<T>(&raw_data)?);
-
-    #[cfg(feature = "state_json")]
-    return Ok(serde_json::from_str::<T>(std::str::from_utf8(raw_data)?)?);
-}
-
-#[cfg(feature = "send_json")]
-pub fn serialize_request<T: ?Sized>(data: &T) -> ZRPCResult<Vec<u8>>
-where
-    T: Serialize,
-{
-    Ok(serde_json::to_string(data)?.into_bytes())
-}
-
-#[cfg(feature = "send_bincode")]
-pub fn serialize_request<T: ?Sized>(data: &T) -> ZRPCResult<Vec<u8>>
-where
-    T: Serialize,
-{
-    Ok(bincode::serialize(data)?)
-}
-
-#[cfg(feature = "send_cbor")]
-pub fn serialize_request<T>(data: &T) -> ZRPCResult<Vec<u8>>
-where
-    T: Serialize,
-{
-    Ok(serde_cbor::to_vec(data)?)
-}
-
-pub fn deserialize_request<T>(raw_data: &[u8]) -> ZRPCResult<T>
-where
-    T: DeserializeOwned,
-{
-    #[cfg(feature = "send_json")]
-    return Ok(serde_json::from_str::<T>(std::str::from_utf8(raw_data)?)?);
-
-    #[cfg(feature = "send_cbor")]
-    return Ok(serde_cbor::from_slice::<T>(&raw_data)?);
-}
-
-pub fn deserialize_router_info(raw_data: &[u8]) -> ZRPCResult<ZRouterInfo> {
-    #[cfg(feature = "router_json")]
-    Ok(serde_json::from_str::<ZRouterInfo>(std::str::from_utf8(
-        raw_data,
-    )?)?)
-}
diff --git a/zrpc/src/types.rs b/zrpc/src/types.rs
deleted file mode 100644
index 96c834b5..00000000
--- a/zrpc/src/types.rs
+++ /dev/null
@@ -1,79 +0,0 @@
-/*********************************************************************************
-* Copyright (c) 2018,2020 ADLINK Technology Inc.
-*
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License 2.0 which is available at
-* http://www.eclipse.org/legal/epl-2.0, or the Apache Software License 2.0
-* which is available at https://www.apache.org/licenses/LICENSE-2.0.
-*
-* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
-* Contributors:
-*   ADLINK fog05 team, <fog05@adlink-labs.tech>
-*********************************************************************************/
-
-extern crate serde;
-
-#[cfg(feature = "send_json")]
-extern crate serde_json;
-//extern crate serde_yaml;
-
-use serde::{Deserialize, Serialize};
-use uuid::Uuid;
-
-#[derive(Clone, PartialEq, Eq, Debug, Hash, Serialize, Deserialize)]
-// pub enum ComponentStatus {
-//     HALTED = 0,
-//     CONNECTED = 1,
-//     BUILDING = 2,
-//     REGISTERED = 3,
-//     ANNOUNCED = 4,
-//     WORK = 5,
-//     UNWORK = 6,
-//     UNANNOUNCED = 7,
-//     UNREGISTERED = 8,
-//     DISCONNECTED = 9,
-// }
-pub enum ComponentStatus {
-    HALTED = 0,
-    INITIALIZING = 1,
-    REGISTERED = 2,
-    SERVING = 3,
-}
-
-// #[derive(PartialEq,Clone, Serialize, Deserialize, Debug)]
-// pub struct ComponentAdvertisement {
-//     pub uuid : Uuid,
-//     pub name : String,
-//     pub routerid : String,
-//     pub peerid : String,
-// }
-
-#[derive(PartialEq, Clone, Serialize, Deserialize, Debug)]
-pub struct ComponentState {
-    pub uuid: Uuid,
-    pub name: String,
-    pub routerid: String,
-    pub peerid: String,
-    pub status: ComponentStatus,
-}
-
-#[derive(Serialize, Deserialize, Debug, Clone)]
-pub struct ZSessionInfo {
-    pub peer: String,
-    pub links: Vec<String>,
-}
-
-#[derive(Serialize, Deserialize, Debug, Clone)]
-pub struct ZPluginInfo {
-    pub name: String,
-    pub path: String,
-}
-
-#[derive(Serialize, Deserialize, Debug, Clone)]
-pub struct ZRouterInfo {
-    pub pid: String,
-    pub locators: Vec<String>,
-    pub sessions: Vec<ZSessionInfo>,
-    pub plugins: Vec<ZPluginInfo>,
-    pub time: Option<String>,
-}
diff --git a/zrpc/src/zchannel.rs b/zrpc/src/zchannel.rs
deleted file mode 100644
index e6871bd7..00000000
--- a/zrpc/src/zchannel.rs
+++ /dev/null
@@ -1,177 +0,0 @@
-/*********************************************************************************
-* Copyright (c) 2018,2020 ADLINK Technology Inc.
-*
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License 2.0 which is available at
-* http://www.eclipse.org/legal/epl-2.0, or the Apache Software License 2.0
-* which is available at https://www.apache.org/licenses/LICENSE-2.0.
-*
-* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
-* Contributors:
-*   ADLINK fog05 team, <fog05@adlink-labs.tech>
-*********************************************************************************/
-
-extern crate base64;
-extern crate serde;
-
-use async_std::sync::Arc;
-use futures::prelude::*;
-use std::convert::TryFrom;
-use std::marker::PhantomData;
-use uuid::Uuid;
-
-use serde::{de::DeserializeOwned, Serialize};
-
-use log::trace;
-
-use crate::serialize;
-use crate::zrpcresult::{ZRPCError, ZRPCResult};
-
-#[derive(Clone)]
-pub struct ZClientChannel<Req, Resp> {
-    z: Arc<zenoh::Zenoh>,
-    path: String,
-    server_uuid: Option<Uuid>,
-    phantom_resp: PhantomData<Resp>,
-    phantom_req: PhantomData<Req>,
-}
-
-impl<Req, Resp> ZClientChannel<Req, Resp>
-where
-    Resp: DeserializeOwned,
-    Req: std::fmt::Debug + Serialize,
-{
-    pub fn new(
-        z: Arc<zenoh::Zenoh>,
-        path: String,
-        server_uuid: Option<Uuid>,
-    ) -> ZClientChannel<Req, Resp> {
-        ZClientChannel {
-            z,
-            path,
-            server_uuid,
-            phantom_resp: PhantomData,
-            phantom_req: PhantomData,
-        }
-    }
-
-    /// This functions calls the get on the workspace for the eval
-    /// it serialized the request on the as properties in the selector
-    /// the request is first serialized as json and then encoded in base64 and
-    /// passed as a property named req
-    async fn send(&self, ws: zenoh::Workspace<'_>, request: &Req) -> ZRPCResult<zenoh::DataStream> {
-        let req = serialize::serialize_request(&request)?;
-        let selector = zenoh::Selector::try_from(format!(
-            "{}/{}/eval?(req={})",
-            self.path,
-            self.server_uuid.unwrap(),
-            base64::encode(req)
-        ))?;
-        //Should create the appropriate Error type and the conversions form ZError
-        trace!("Sending {:?} to  {:?}", request, selector);
-        Ok(ws.get(&selector).await?)
-    }
-
-    /// This function calls the eval on the server and deserialized the result
-    /// if the value is not deserializable or the eval returns none it returns an IOError
-    pub async fn call_fun(&self, request: Req) -> ZRPCResult<Resp> {
-        let ws = self.z.workspace(None).await?;
-        let mut data_stream = self.send(ws, &request).await?;
-        //takes only one, eval goes to only one
-        let resp = data_stream.next().await;
-        log::trace!("Response from zenoh is {:?}", resp);
-        if let Some(data) = resp {
-            let value = data.value;
-            match value {
-                zenoh::Value::Raw(_size, rbuf) => {
-                    let raw_data = rbuf.to_vec();
-                    log::trace!("Size of response is {}", raw_data.len());
-                    Ok(serialize::deserialize_response(&raw_data)?)
-                }
-                _ => Err(ZRPCError::ZenohError(
-                    "Response data is expected to be RAW in Zenoh!!".to_string(),
-                )),
-            }
-        } else {
-            log::error!("No data from server");
-            Err(ZRPCError::ZenohError(format!(
-                "No data from call_fun for Request {:?}",
-                request
-            )))
-        }
-    }
-
-    /// This function verifies is the server is still available to reply at requests
-    /// it first verifies that it is register in Zenoh, then it verifies if the peer is still connected,
-    /// and then verifies the state, it returns an std::io::Result, the Err case describe the error.
-    pub async fn verify_server(&self) -> ZRPCResult<bool> {
-        if self.server_uuid.is_none() {
-            return Ok(false);
-        }
-
-        let ws = self.z.workspace(None).await?;
-
-        let selector = zenoh::Selector::try_from(format!(
-            "{}/{}/state",
-            self.path,
-            self.server_uuid.unwrap()
-        ))?;
-
-        let ds = ws.get(&selector).await?;
-        let idata: Vec<zenoh::Data> = ds.collect().await;
-
-        if idata.is_empty() {
-            return Ok(false);
-        }
-
-        let iv = &idata[0];
-        match &iv.value {
-            zenoh::Value::Raw(_, buf) => {
-                let raw_data = buf.to_vec();
-                log::trace!("Size of state is {}", raw_data.len());
-                let cs = serialize::deserialize_state::<super::ComponentState>(&raw_data)?;
-                let selector =
-                    zenoh::Selector::try_from(format!("/@/router/{}", String::from(&cs.routerid)))?;
-                let mut ds = ws.get(&selector).await?;
-                let mut rdata = Vec::new();
-
-                while let Some(d) = ds.next().await {
-                    rdata.push(d)
-                }
-
-                if rdata.len() != 1 {
-                    return Err(ZRPCError::NotFound);
-                }
-
-                let rv = &rdata[0];
-                match &rv.value {
-                    zenoh::Value::Json(sv) => {
-                        log::trace!("Size of Zenoh router state is {}", sv.len());
-                        let ri = serde_json::from_str::<super::types::ZRouterInfo>(&sv)?;
-                        let mut it = ri.sessions.iter();
-                        let f = it.find(|&x| x.peer == String::from(&cs.peerid).to_uppercase());
-
-                        if f.is_none() {
-                            return Ok(false);
-                        }
-
-                        match cs.status {
-                            super::ComponentStatus::SERVING => return Ok(true),
-                            _ => return Ok(false),
-                        }
-                    }
-                    _ => {
-                        return Err(ZRPCError::ZenohError(
-                            "Router information is not encoded in JSON".to_string(),
-                        ));
-                    }
-                }
-            }
-            _ => {
-                return Err(ZRPCError::ZenohError(
-                    "Component state is expected to be RAW in Zenoh!!".to_string(),
-                ));
-            }
-        }
-    }
-}
diff --git a/zrpc/src/znchannel.rs b/zrpc/src/znchannel.rs
deleted file mode 100644
index 1c5f3999..00000000
--- a/zrpc/src/znchannel.rs
+++ /dev/null
@@ -1,143 +0,0 @@
-/*********************************************************************************
-* Copyright (c) 2018,2020 ADLINK Technology Inc.
-*
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License 2.0 which is available at
-* http://www.eclipse.org/legal/epl-2.0, or the Apache Software License 2.0
-* which is available at https://www.apache.org/licenses/LICENSE-2.0.
-*
-* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
-* Contributors:
-*   ADLINK fog05 team, <fog05@adlink-labs.tech>
-*********************************************************************************/
-
-extern crate base64;
-extern crate serde;
-
-use async_std::sync::Arc;
-use futures::prelude::*;
-use serde::{de::DeserializeOwned, Serialize};
-use std::marker::PhantomData;
-use uuid::Uuid;
-
-use zenoh::net::QueryConsolidation;
-use zenoh::net::QueryTarget;
-
-use log::trace;
-
-use crate::serialize;
-use crate::zrpcresult::{ZRPCError, ZRPCResult};
-
-#[derive(Clone)]
-pub struct ZNClientChannel<Req, Resp> {
-    z: Arc<zenoh::net::Session>,
-    path: String,
-    server_uuid: Option<Uuid>,
-    phantom_resp: PhantomData<Resp>,
-    phantom_req: PhantomData<Req>,
-}
-
-impl<Req, Resp> ZNClientChannel<Req, Resp>
-where
-    Resp: DeserializeOwned,
-    Req: std::fmt::Debug + Serialize,
-{
-    pub fn new(
-        z: Arc<zenoh::net::Session>,
-        path: String,
-        server_uuid: Option<Uuid>,
-    ) -> ZNClientChannel<Req, Resp> {
-        ZNClientChannel {
-            z,
-            path,
-            server_uuid,
-            phantom_resp: PhantomData,
-            phantom_req: PhantomData,
-        }
-    }
-
-    /// This functions calls the get on the workspace for the eval
-    /// it serialized the request on the as properties in the selector
-    /// the request is first serialized as json and then encoded in base64 and
-    /// passed as a property named req
-    async fn send(
-        &self,
-        zsession: &zenoh::net::Session,
-        request: &Req,
-    ) -> ZRPCResult<async_std::channel::Receiver<zenoh::net::Reply>> {
-        let req = serialize::serialize_request(&request)?;
-        let selector = format!("{}{}/eval", self.path, self.server_uuid.unwrap(),);
-        let predicate = base64::encode(req).to_string();
-
-        //Should create the appropriate Error type and the conversions form ZError
-        trace!("Sending {:?} to  {:?} {:?}", request, selector, predicate);
-        let replies = zsession
-            .query(
-                &selector.into(),
-                &predicate,
-                QueryTarget::default(),
-                QueryConsolidation::default(),
-            )
-            .await?;
-        Ok(replies)
-    }
-
-    /// This function calls the eval on the server and deserialized the result
-    /// if the value is not deserializable or the eval returns none it returns an IOError
-    pub async fn call_fun(&self, request: Req) -> ZRPCResult<Resp> {
-        let mut data_stream = self.send(&self.z, &request).await?;
-        //takes only one, eval goes to only one
-        let resp = data_stream.next().await;
-        log::trace!("Response from zenoh is {:?}", resp);
-        if let Some(reply) = resp {
-            let rbuf = reply.data.payload;
-            let raw_data = rbuf.to_vec();
-            log::trace!("Size of response is {}", raw_data.len());
-            Ok(serialize::deserialize_response(&raw_data)?)
-        } else {
-            log::error!("No data from server");
-            Err(ZRPCError::ZenohError(format!(
-                "No data from call_fun for Request {:?}",
-                request
-            )))
-        }
-    }
-
-    /// This function verifies is the server is still available to reply at requests
-    /// it first verifies that it is register in Zenoh, then it verifies if the peer is still connected,
-    /// and then verifies the state, it returns an std::io::Result, the Err case describe the error.
-    pub async fn verify_server(&self) -> ZRPCResult<bool> {
-        if self.server_uuid.is_none() {
-            return Ok(false);
-        }
-
-        log::trace!(
-            "Check server selector {}",
-            format!("{}{}/state", self.path, self.server_uuid.unwrap())
-        );
-        let selector = format!("{}{}/state", self.path, self.server_uuid.unwrap());
-        let mut replies = self
-            .z
-            .query(
-                &selector.into(),
-                "",
-                QueryTarget::default(),
-                QueryConsolidation::default(),
-            )
-            .await?;
-
-        let resp = replies.next().await;
-        log::trace!("Response from zenoh is {:?}", resp);
-
-        if let Some(reply) = resp {
-            let rbuf = reply.data.payload;
-            let ca = crate::serialize::deserialize_state::<crate::types::ComponentState>(
-                &rbuf.to_vec(),
-            )?;
-            if ca.status == crate::types::ComponentStatus::SERVING {
-                return Ok(true);
-            }
-        }
-        Ok(false)
-    }
-}
diff --git a/zrpc/src/zrpcresult.rs b/zrpc/src/zrpcresult.rs
deleted file mode 100644
index a3ae7125..00000000
--- a/zrpc/src/zrpcresult.rs
+++ /dev/null
@@ -1,125 +0,0 @@
-/*********************************************************************************
-* Copyright (c) 2018,2020 ADLINK Technology Inc.
-*
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License 2.0 which is available at
-* http://www.eclipse.org/legal/epl-2.0, or the Apache Software License 2.0
-* which is available at https://www.apache.org/licenses/LICENSE-2.0.
-*
-* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
-* Contributors:
-*   ADLINK fog05 team, <fog05@adlink-labs.tech>
-*********************************************************************************/
-
-extern crate serde;
-
-use serde::{Deserialize, Serialize};
-use std::fmt;
-use thiserror::Error;
-
-#[derive(Error, Debug, Serialize, Deserialize, Clone)]
-pub enum ZRPCError {
-    DeserializationError(String),
-    SerializationError(String),
-    ZenohError(String),
-    StateTransitionNotAllowed(String),
-    Error(String),
-    IOError(String),
-    ChannelError(String),
-    TimedOut,
-    MissingValue,
-    NotFound,
-    Unreachable,
-    PermissionDenied,
-    Unavailable,
-    NoRouter,
-}
-
-impl fmt::Display for ZRPCError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        match self {
-            ZRPCError::DeserializationError(err) => write!(f, "{}", err),
-            ZRPCError::SerializationError(err) => write!(f, "{}", err),
-            ZRPCError::ZenohError(err) => write!(f, "{}", err),
-            ZRPCError::StateTransitionNotAllowed(err) => write!(f, "{}", err),
-            ZRPCError::Error(err) => write!(f, "{}", err),
-            ZRPCError::IOError(err) => write!(f, "{}", err),
-            ZRPCError::ChannelError(err) => write!(f, "{}", err),
-            ZRPCError::MissingValue => write!(f, "Missing Value in Option"),
-            ZRPCError::NotFound => write!(f, "Component not found"),
-            ZRPCError::Unreachable => write!(f, "Unreachable code!"),
-            ZRPCError::TimedOut => write!(f, "ZRPC call has timed out!"),
-            ZRPCError::PermissionDenied => write!(f, "ZRPC Permission denied"),
-            ZRPCError::Unavailable => write!(f, "ZRPC Unavailable"),
-            ZRPCError::NoRouter => write!(f, "No router found"),
-        }
-    }
-}
-
-#[cfg(any(
-    feature = "resp_bincode",
-    feature = "state_bincode",
-    feature = "send_bincode"
-))]
-impl From<Box<bincode::ErrorKind>> for ZRPCError {
-    fn from(err: Box<bincode::ErrorKind>) -> Self {
-        ZRPCError::SerializationError(err.to_string())
-    }
-}
-
-#[cfg(any(feature = "resp_cbor", feature = "state_cbor", feature = "send_cbor"))]
-impl From<serde_cbor::Error> for ZRPCError {
-    fn from(err: serde_cbor::Error) -> Self {
-        ZRPCError::SerializationError(err.to_string())
-    }
-}
-
-#[cfg(any(
-    feature = "send_json",
-    feature = "state_json",
-    feature = "resp_json",
-    feature = "router_json"
-))]
-impl From<serde_json::Error> for ZRPCError {
-    fn from(err: serde_json::Error) -> Self {
-        ZRPCError::SerializationError(err.to_string())
-    }
-}
-
-#[cfg(any(
-    feature = "send_json",
-    feature = "state_json",
-    feature = "resp_json",
-    feature = "router_json"
-))]
-impl From<std::str::Utf8Error> for ZRPCError {
-    fn from(err: std::str::Utf8Error) -> Self {
-        ZRPCError::DeserializationError(err.to_string())
-    }
-}
-
-impl From<zenoh::ZError> for ZRPCError {
-    fn from(err: zenoh::ZError) -> Self {
-        ZRPCError::ZenohError(err.to_string())
-    }
-}
-
-impl From<std::io::Error> for ZRPCError {
-    fn from(err: std::io::Error) -> Self {
-        ZRPCError::IOError(err.to_string())
-    }
-}
-
-impl From<async_std::channel::RecvError> for ZRPCError {
-    fn from(err: async_std::channel::RecvError) -> Self {
-        ZRPCError::ChannelError(err.to_string())
-    }
-}
-
-impl<T> From<async_std::channel::SendError<T>> for ZRPCError {
-    fn from(err: async_std::channel::SendError<T>) -> Self {
-        ZRPCError::ChannelError(err.to_string())
-    }
-}
-
-pub type ZRPCResult<T> = Result<T, ZRPCError>;


Test patch:
diff --git a/zrpc-perf/run-test.sh b/zrpc-perf/run-test.sh
deleted file mode 100755
index 0b88cb16..00000000
--- a/zrpc-perf/run-test.sh
+++ /dev/null
@@ -1,278 +0,0 @@
-#!/usr/bin/env bash
-
-
-plog () {
-TS=`eval date "+%F-%T"`
-   echo "[$TS]: $1"
-}
-
-TS=$(date "+%F-%T")
-
-INITIAL_SIZE=8
-END_SIZE=65536
-
-BIN_DIR="./target/release"
-
-WD=$(pwd)
-
-SERVER_BIN="gserver"
-CLIENT_BIN="gclient"
-
-GET_BIN="get"
-QUERY_BIN="query"
-
-CALL_BIN="zrpc_call"
-
-NCALL_BIN="znrpc_call"
-
-EVAL_BIN="eval"
-GET_EVAL_BIN="get_eval"
-
-NET_EVAL_BIN="queryable"
-NET_GET_EVAL_BIN="query_eval"
-
-STATE_BIN="zrpc_state"
-ZSTATE_BIN="zrpc_get_zenoh"
-
-SER_BIN="serialization"
-DE_BIN="deserialization"
-
-ZENOH_REPO="https://github.com/eclipse-zenoh/zenoh"
-ZENOH_BRANCH="master"
-ZENOH_DIR="$WD/zenoh"
-
-OUT_DIR="results"
-
-DURATION=20
-ZENOHD_PATH="$ZENOH_DIR/target/release/zenohd"
-
-if [[ ! -d $ZENOH_DIR ]];
-then
-   plog "Cloning and building zenoh from $ZENOH_REPO branch $ZENOH_BRANCH"
-   git clone $ZENOH_REPO -b $ZENOH_BRANCH $ZENOH_DIR
-   cd $ZENOH_DIR
-   cargo build --release
-   cd $WD
-else
-   cd $ZENOH_DIR
-   git pull
-   cargo build --release
-   cd $WD
-fi
-
-
-mkdir -p $OUT_DIR
-
-plog "Running baseline gRPC bench"
-
-x=8
-while [ $x -le $END_SIZE ]
-do
-   nohup $BIN_DIR/$SERVER_BIN -a 127.0.0.1:50001 -s $x > /dev/null 2>&1 &
-   SERVER_PID=$!
-   plog "Server PID $SERVER_PID"
-   plog "Running gRPC bench with $x size"
-   $BIN_DIR/$CLIENT_BIN -d $DURATION -i 1 -a 127.0.0.1:50001 -s $x > $OUT_DIR/grpc-$x-$TS.csv
-   plog "Done gRPC bench with $x size"
-   kill -9 $SERVER_PID
-   x=$(( $x * 2 ))
-done
-
-plog "Running baseline get bench"
-
-x=$INITIAL_SIZE
-while [ $x -le $END_SIZE ]
-do
-   nohup $ZENOHD_PATH --mem-storage "/test/**" -l tcp/127.0.0.1:7447 > /dev/null 2>&1 &
-   ZENOHD_PID=$!
-   plog "Zenohd running PID $ZENOHD_PID"
-   plog "Running GET bench with $x size"
-   $BIN_DIR/$GET_BIN -d $DURATION -i 1 -m client -p tcp/127.0.0.1:7447 -s $x > $OUT_DIR/get-$x-$TS.csv
-   plog "Done GET bench with $x size"
-   kill -9 $ZENOHD_PID
-   x=$(( $x * 2 ))
-done
-
-
-plog "Running baseline query bench"
-
-x=$INITIAL_SIZE
-while [ $x -le $END_SIZE ]
-do
-   nohup $ZENOHD_PATH --mem-storage "/test/**" -l tcp/127.0.0.1:7447 > /dev/null 2>&1 &
-   ZENOHD_PID=$!
-   plog "Zenohd running PID $ZENOHD_PID"
-   plog "Running QUERY bench with $x size"
-   $BIN_DIR/$QUERY_BIN -d $DURATION -i 1 -m client -p tcp/127.0.0.1:7447 -s $x > $OUT_DIR/query-$x-$TS.csv
-   plog "Done QUERY bench with $x size"
-   kill -9 $ZENOHD_PID
-   x=$(( $x * 2 ))
-done
-
-
-plog "Running baseline net queryable bench"
-
-x=$INITIAL_SIZE
-while [ $x -le $END_SIZE ]
-do
-   nohup $ZENOHD_PATH --mem-storage "/test/**" -l tcp/127.0.0.1:7447 > /dev/null 2>&1 &
-   ZENOHD_PID=$!
-   plog "Zenohd running PID $ZENOHD_PID"
-   nohup $BIN_DIR/$NET_EVAL_BIN -m client -p tcp/127.0.0.1:7447 -s $x > /dev/null 2>&1 &
-   EV_PID=$!
-   plog "Queryable PID $EV_PID"
-   plog "Running Queryable bench with $x size"
-   $BIN_DIR/$NET_GET_EVAL_BIN -d $DURATION -i 1 -m client -p tcp/127.0.0.1:7447 -s $x > $OUT_DIR/queryable-$x-$TS.csv
-   plog "Done Queryable bench with $x size"
-   kill -9 $ZENOHD_PID
-   kill -9 $EV_PID
-   x=$(( $x * 2 ))
-done
-
-
-plog "Running baseline net p2p queryable bench"
-
-x=$INITIAL_SIZE
-while [ $x -le $END_SIZE ]
-do
-   nohup $BIN_DIR/$NET_EVAL_BIN  -s $x > /dev/null 2>&1 &
-   EV_PID=$!
-   plog "Queryable PID $EV_PID"
-   plog "Running Queryable P2P bench with $x size"
-   $BIN_DIR/$NET_GET_EVAL_BIN -d $DURATION -i 1 -s $x > $OUT_DIR/p2p-queryable-$x-$TS.csv
-   plog "Done Queryable P2P bench with $x size"
-   kill -9 $EV_PID
-   x=$(( $x * 2 ))
-done
-
-plog "Running baseline eval bench"
-
-x=$INITIAL_SIZE
-while [ $x -le $END_SIZE ]
-do
-   nohup $ZENOHD_PATH --mem-storage "/test/**" -l tcp/127.0.0.1:7447 > /dev/null 2>&1 &
-   ZENOHD_PID=$!
-   plog "Zenohd running PID $ZENOHD_PID"
-   nohup $BIN_DIR/$EVAL_BIN -m client -p tcp/127.0.0.1:7447 -s $x > /dev/null 2>&1 &
-   EV_PID=$!
-   plog "Eval PID $EV_PID"
-   plog "Running EVAL bench with $x size"
-   $BIN_DIR/$GET_EVAL_BIN -d $DURATION -i 1 -m client -p tcp/127.0.0.1:7447 -s $x > $OUT_DIR/eval-$x-$TS.csv
-   plog "Done EVAL bench with $x size"
-   kill -9 $ZENOHD_PID
-   kill -9 $EV_PID
-   x=$(( $x * 2 ))
-done
-
-plog "Running ZRPC Call bench"
-
-
-x=$INITIAL_SIZE
-while [ $x -le $END_SIZE ]
-do
-   plog "Starting zenohd..."
-   nohup $ZENOHD_PATH --mem-storage "/test/**" -l tcp/127.0.0.1:7447 > /dev/null 2>&1 &
-   ZENOHD_PID=$!
-   plog "Zenohd running PID $ZENOHD_PID"
-   sleep 2
-   nohup $BIN_DIR/$CALL_BIN -m server -r tcp/127.0.0.1:7447 -s $x > /tmp/server.out 2>&1 &
-   SERVER_PID=$!
-   plog "ZRPC Server running $SERVER_PID"
-   sleep 6
-   plog "Running zrpc call bench with $x size"
-   $BIN_DIR/$CALL_BIN -d $DURATION -i 1 -m client -r tcp/127.0.0.1:7447 -s $x  > $OUT_DIR/call-$x-$TS.csv
-   plog "Done ZRPC Call bench, killing server and zenoh"
-   kill -9 $SERVER_PID
-   kill -9 $ZENOHD_PID
-   x=$(( $x * 2 ))
-done
-
-
-plog "Running ZRPC Call w/o check bench"
-
-
-x=$INITIAL_SIZE
-while [ $x -le $END_SIZE ]
-do
-   plog "Starting zenohd..."
-   nohup $ZENOHD_PATH --mem-storage "/test/**" -l tcp/127.0.0.1:7447 > /dev/null 2>&1 &
-   ZENOHD_PID=$!
-   plog "Zenohd running PID $ZENOHD_PID"
-   sleep 2
-   nohup $BIN_DIR/$CALL_BIN -m server -r tcp/127.0.0.1:7447 -s $x > /tmp/server.out 2>&1 &
-   SERVER_PID=$!
-   plog "ZRPC Server running $SERVER_PID"
-   sleep 6
-   plog "Running zrpc call w/o chk bench with $x size"
-   $BIN_DIR/$CALL_BIN -d $DURATION -i 1 -m client -r tcp/127.0.0.1:7447 -s $x -n > $OUT_DIR/nochk-call-$x-$TS.csv
-   plog "Done ZRPC Call bench, killing server and zenoh"
-   kill -9 $SERVER_PID
-   kill -9 $ZENOHD_PID
-   x=$(( $x * 2 ))
-done
-
-
-plog "Running ZNRPC Call bench"
-x=$INITIAL_SIZE
-while [ $x -le $END_SIZE ]
-do
-   plog "Starting zenohd..."
-   nohup $ZENOHD_PATH --mem-storage "/test/**" -l tcp/127.0.0.1:7447 > /dev/null 2>&1 &
-   ZENOHD_PID=$!
-   plog "Zenohd running PID $ZENOHD_PID"
-   sleep 2
-   nohup $BIN_DIR/$NCALL_BIN -z client -m server -r tcp/127.0.0.1:7447 -s $x > /tmp/server.out 2>&1 &
-   SERVER_PID=$!
-   plog "ZNRPC Server running $SERVER_PID"
-   sleep 6
-   plog "Running ZNRPC call bench with $x size"
-   $BIN_DIR/$NCALL_BIN -d $DURATION -z client -i 1 -m client -r tcp/127.0.0.1:7447 -s $x > $OUT_DIR/zcall-$x-$TS.csv
-   plog "Done ZNRPC Call bench, killing server and zenoh"
-   kill -9 $SERVER_PID
-   kill -9 $ZENOHD_PID
-   x=$(( $x * 2 ))
-done
-
-
-plog "Running P2P ZNRPC Call bench"
-x=$INITIAL_SIZE
-while [ $x -le $END_SIZE ]
-do
-   nohup $BIN_DIR/$NCALL_BIN -z peer -m server -s $x > /tmp/server.out 2>&1 &
-   SERVER_PID=$!
-   plog "P2P ZNRPC Server running $SERVER_PID"
-   sleep 5
-   plog "Running P2P ZNRPC call bench with $x size"
-   $BIN_DIR/$NCALL_BIN -d $DURATION -z peer -i 1 -m client -s $x > $OUT_DIR/p2p-zcall-$x-$TS.csv
-   plog "Done P2P ZNRPC Call bench, killing server and zenoh"
-   kill -9 $SERVER_PID
-   x=$(( $x * 2 ))
-done
-
-
-plog "Running ZNRPC Response Serialization bench"
-x=$INITIAL_SIZE
-while [ $x -le $END_SIZE ]
-do
-   plog "Running ZNRPC Response Serialization bench with $x size"
-   $BIN_DIR/$SER_BIN -d $DURATION -i 1 -s $x > $OUT_DIR/serialize-$x-$TS.csv
-   plog "Done ZNRPC Response Serialization"
-   x=$(( $x * 2 ))
-done
-
-plog "Running ZNRPC Response Deserialization bench"
-x=$INITIAL_SIZE
-while [ $x -le $END_SIZE ]
-do
-   plog "Running ZNRPC Response Deserialization bench with $x size"
-   $BIN_DIR/$DE_BIN -d $DURATION -i 1 -s $x > $OUT_DIR/deserialize-$x-$TS.csv
-   plog "Done ZNRPC Response Deserialization"
-   x=$(( $x * 2 ))
-done
-
-
-
-plog "Done Test results stored in $OUT_DIR, killing zenohd"
-plog "Bye!"
-
-