Open
Description
Hi,
This looks like a good lib and I am trying to use it.
Your examples are useful, but it would be good to also hint on how to really use it.
my main.rs
use std::net::SocketAddr;
use std::time::Duration;
use async_std::task;
use futures::future::join_all;
use async_port_scanner::Scanner;
fn main() {
let ps = Scanner::new(Duration::from_secs(4));
let my_ftr = ps.run_batched("127.0.0.1".to_string(), 1, 65535, 3000);
let dev1_ftr = ps.run_batched("192.168.2.220".to_string(), 1, 65535, 3000);
let all_ftrs = vec![my_ftr, dev1_ftr];
let results: Vec<Vec<SocketAddr>> = task::block_on(async move { join_all(all_ftrs).await });
println!("{:?}", results);
}
My Cargo.toml dependencies:
[dependencies]
async-port-scanner = "0.1.3"
futures = "0.3"
async-std = "1.5"
However, this results in the error:
cargo run
Compiling rnetworkview v0.1.0 (/.../Projects/rnetworkview)
Finished dev [unoptimized + debuginfo] target(s) in 2.00s
Running `target/debug/rnetworkview`
thread 'main' panicked at 'cannot run an executor inside another executor', <::std::macros::panic macros>:2:4
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Metadata
Assignees
Labels
No labels