Address compiler warnings #10
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "utils/native_file.hpp"
|
||||
#include "utils/path_utils.hpp"
|
||||
#include "utils/string_utils.hpp"
|
||||
#include <limits>
|
||||
|
||||
namespace repertory::utils {
|
||||
void calculate_allocation_size(bool directory, std::uint64_t file_size,
|
||||
@@ -244,13 +245,19 @@ auto get_next_available_port(std::uint16_t first_port,
|
||||
std::uint16_t &available_port) -> bool {
|
||||
using namespace boost::asio;
|
||||
using ip::tcp;
|
||||
boost::system::error_code error_code;
|
||||
do {
|
||||
io_service svc;
|
||||
|
||||
boost::system::error_code error_code{};
|
||||
while (first_port != 0U) {
|
||||
io_service svc{};
|
||||
tcp::acceptor acceptor(svc);
|
||||
acceptor.open(tcp::v4(), error_code) ||
|
||||
acceptor.bind({tcp::v4(), first_port}, error_code);
|
||||
} while (error_code && (first_port++ < 65535U));
|
||||
if (not error_code) {
|
||||
break;
|
||||
}
|
||||
|
||||
++first_port;
|
||||
}
|
||||
|
||||
if (not error_code) {
|
||||
available_port = first_port;
|
||||
|
Reference in New Issue
Block a user