#port #network

port_check

Get a free local port or check if a port somewhere is reachable

6 releases

0.1.5 Jan 16, 2020
0.1.4 Jan 3, 2020
0.1.3 Dec 28, 2019
0.1.2 Nov 10, 2019
0.1.0 Mar 21, 2019

#528 in Network programming

Download history 3947/week @ 2022-06-08 2506/week @ 2022-06-15 2656/week @ 2022-06-22 2946/week @ 2022-06-29 2339/week @ 2022-07-06 2726/week @ 2022-07-13 3634/week @ 2022-07-20 3114/week @ 2022-07-27 3878/week @ 2022-08-03 3469/week @ 2022-08-10 2521/week @ 2022-08-17 2272/week @ 2022-08-24 4497/week @ 2022-08-31 2821/week @ 2022-09-07 5137/week @ 2022-09-14 2692/week @ 2022-09-21

15,797 downloads per month
Used in fewer than 6 crates

MIT license

7KB
133 lines

port_check

A simple rust library to get a free local port or to check if a port somewhere is reachable

Example:


// get a free local port
let free_port = port_check::free_local_port();

// get a free local port between 10000 and 15000
let free_port_in_range = port_check::free_local_port_in_range(10000, 15000);

// check whether a remote port is reachable
let is_reachable = port_check::is_port_reachable("192.0.2.0:8080");
// or
let is_reachable = is_port_reachable_with_timeout("192.0.2.0:8080", Duration::from_millis(10_000));


No runtime deps