Function zenoh::net::scout[][src]

pub async fn scout(what: WhatAmI, config: ConfigProperties) -> HelloStream

Scout for routers and/or peers.

scout spawns a task that periodically sends scout messages and returns a HelloStream : a stream of received Hello messages.

Drop the returned HelloStream to stop the scouting task.

Arguments

  • what - The kind of zenoh process to scout for
  • config - The configuration Properties to use for scouting

Examples

use zenoh::net::*;
use futures::prelude::*;

let mut stream = scout(whatami::PEER | whatami::ROUTER, config::default()).await;
while let Some(hello) = stream.next().await {
    println!("{}", hello);
}