reth::network::test_utils

Function unused_port

pub fn unused_port() -> u16
Available on crate feature test-utils only.
Expand description

A bit of hack to find an unused TCP port.

Does not guarantee that the given port is unused after the function exists, just that it was unused before the function started (i.e., it does not reserve a port).