11 std::shared_ptr<boost::asio::io_context> context,
13 uint16_t port_tolerance,
17 auto acceptor = std::make_unique<Acceptor>(*context, endpoint);
20 const boost::wrapexcept<boost::system::system_error> &exception) {
21 if ((exception.code() == boost::asio::error::address_in_use)
22 and (port_tolerance > 0)) {
24 "Port {} is already in use, trying next one. ({} attempt(s) " 29 endpoint.port(endpoint.port() + 1);
std::unique_ptr< Acceptor > acceptOnFreePort(std::shared_ptr< boost::asio::io_context > context, Endpoint endpoint, uint16_t port_tolerance, const log::Logger &logger)
std::shared_ptr< soralog::Logger > Logger
boost::asio::ip::tcp::endpoint Endpoint