#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

#230 in Network programming

Download history 332/week @ 2020-10-28 468/week @ 2020-11-04 195/week @ 2020-11-11 368/week @ 2020-11-18 317/week @ 2020-11-25 368/week @ 2020-12-02 384/week @ 2020-12-09 382/week @ 2020-12-16 304/week @ 2020-12-23 297/week @ 2020-12-30 614/week @ 2021-01-06 414/week @ 2021-01-13 528/week @ 2021-01-20 595/week @ 2021-01-27 590/week @ 2021-02-03 547/week @ 2021-02-10

1,307 downloads per month
Used in 3 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