| 124 | // Select a random port from an offer. |
| 125 | template <typename R> |
| 126 | static uint16_t selectRandomPort(const R& resources) |
| 127 | { |
| 128 | auto ports = resources.ports()->range(0); |
| 129 | return ports.begin() + std::rand() % (ports.end() - ports.begin() + 1); |
| 130 | } |
| 131 | |
| 132 | |
| 133 | // Select a random port that is not the same as the one given. |
no test coverage detected