From 8a15f5f664f447d42fe60e0364c09bfd586cdd47 Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Wed, 20 Nov 2024 22:49:25 +0300 Subject: [PATCH] Update z_pub_thr.rs --- examples/examples/z_pub_thr.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/examples/z_pub_thr.rs b/examples/examples/z_pub_thr.rs index dc18715e2a..bb68e22547 100644 --- a/examples/examples/z_pub_thr.rs +++ b/examples/examples/z_pub_thr.rs @@ -46,6 +46,12 @@ fn main() { .congestion_control(CongestionControl::Block) .priority(prio) .express(args.express) + .allowed_destination({ + match args.remote { + true => zenoh::sample::Locality::Remote, + false => zenoh::sample::Locality::Any, + } + }) .wait() .unwrap(); @@ -70,6 +76,9 @@ fn main() { #[derive(Parser, Clone, PartialEq, Eq, Hash, Debug)] struct Args { + /// remote-only locality for sending data + #[arg(short, long, default_value = "false")] + remote: bool, /// express for sending data #[arg(long, default_value = "false")] express: bool,