Kagome
Polkadot Runtime Engine in C++17
tuner.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_TUNER_HPP
7 #define KAGOME_TUNER_HPP
8 
9 #include <memory>
10 
11 #include <boost/asio/ip/tcp.hpp>
13 #include "log/logger.hpp"
14 
15 namespace kagome::api {
16 
17  constexpr uint16_t kDefaultPortTolerance = 10;
18 
19  using Acceptor = boost::asio::ip::tcp::acceptor;
20  using Endpoint = boost::asio::ip::tcp::endpoint;
21 
22  std::unique_ptr<Acceptor> acceptOnFreePort(
23  std::shared_ptr<boost::asio::io_context> context,
24  Endpoint endpoint,
25  uint16_t port_tolerance,
26  const log::Logger &logger);
27 
28 } // namespace kagome::api
29 
30 #endif // KAGOME_TUNER_HPP
std::unique_ptr< Acceptor > acceptOnFreePort(std::shared_ptr< boost::asio::io_context > context, Endpoint endpoint, uint16_t port_tolerance, const log::Logger &logger)
Definition: tuner.cpp:10
std::shared_ptr< soralog::Logger > Logger
Definition: logger.hpp:23
boost::asio::ip::tcp::endpoint Endpoint
Definition: tuner.hpp:20
boost::asio::ip::tcp::acceptor Acceptor
Definition: tuner.hpp:19
constexpr uint16_t kDefaultPortTolerance
Definition: tuner.hpp:17