Function zenoh::net::open[][src]

pub fn open(config: ConfigProperties) -> impl ZFuture<Output = ZResult<Session>>
Expand description

Open a zenoh-net Session.

Arguments

Examples

use zenoh::net::*;

let session = open(config::peer()).await.unwrap();

Configuration Properties

ConfigProperties are a set of key/value (u64/String) pairs. Constants for the accepted keys can be found in the config module. Multiple values are coma separated.

Examples

use zenoh::net::*;

let mut config = config::peer();
config.insert(config::ZN_LOCAL_ROUTING_KEY, "false".to_string());
config.insert(config::ZN_PEER_KEY, "tcp/10.10.10.10:7447,tcp/11.11.11.11:7447".to_string());

let session = open(config).await.unwrap();

ConfigProperties can be built set of key/value (String/String) set of Properties.

Examples

use zenoh::Properties;
use zenoh::net::*;

let mut config = Properties::default();
config.insert("local_routing".to_string(), "false".to_string());
config.insert("peer".to_string(), "tcp/10.10.10.10:7447,tcp/11.11.11.11:7447".to_string());

let session = open(config.into()).await.unwrap();