Module local_ip_utils

Source

Functions§

get_available_port
Return an ephemeral, available port. On unix systems, the port returned will be in the TIME_WAIT state ensuring that the OS won’t hand out this port for some grace period. Callers should be able to bind to this port given they use SO_REUSEADDR.
get_new_ip
In non-simtest, we always only have one IP address which is localhost.
localhost_for_testing
Returns localhost, which is always 127.0.0.1.
new_deterministic_tcp_address_for_testing
new_deterministic_udp_address_for_testing
new_local_tcp_address_for_testing
Returns a new unique TCP address (Multiaddr) for localhost, by finding a new available port on localhost.
new_local_tcp_socket_for_testing
Returns a new unique TCP address (SocketAddr) for localhost, by finding a new available port on localhost.
new_local_udp_address_for_testing
Returns a new unique UDP address for localhost, by finding a new available port.
new_tcp_address_for_testing
Returns a new unique TCP address for the given host, by finding a new available port.
new_udp_address_for_testing
Returns a new unique UDP address for the given host, by finding a new available port.