[][src]Function oports::get_all_open_ports

pub async fn get_all_open_ports(
    ip: IpAddr,
    concurrency: Option<usize>
) -> Vec<u16>

Retrieves a vec with all open ports for a given IP address. The default concurrency is 100 if the Option resolves to a None value.


use async_std::net::{IpAddr, Ipv4Addr};

let ip_v4_addr = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1));
let concurrency = Some(100);

let open_ports = oports::get_all_open_ports(ip_v4_addr, concurrency).await;

assert_eq!(vec![4040], open_ports);