holoscan::get_unused_network_ports
holoscan::get_unused_network_ports
Generate a list of unused network ports within a specified range.
This method generates a vector of unused network ports based on the specified parameters. The generated ports are guaranteed to be unused at the time of generation. The generated ports can be used to bind to a network socket. The generated ports are not guaranteed to remain unused after generation.
Returns: The vector containing the generated unused network ports.
Parameters
The number of unused ports to generate (default: 1).
The minimum value of the port range (default: 10000).
The maximum value of the port range (default: 32767).
The vector of ports to exclude from the generated list (default: empty).
The vector of ports to prefer in the generated list (default: empty).