get-port | crate
Get an available TCP/UDP port
Information
Example
For more examples, check src/tests.rs
.
// Return an available port, from the supplied range, available on localhost.
use TcpPort;
use ;
use UdpPort;
let tcp_port = in_range.unwrap;
let udp_port = in_range.unwrap;