33 #include <boost/thread.hpp> 34 #include <boost/bind/bind.hpp> 40 #undef ELECTRONEUM_DEFAULT_LOG_CATEGORY 41 #define ELECTRONEUM_DEFAULT_LOG_CATEGORY "net.http" 46 template<
class t_child_
class,
class t_connection_context = epee::net_utils::connection_context_base>
60 std::vector<std::string> access_control_origins = std::vector<std::string>(),
61 boost::optional<net_utils::http::login> user = boost::none,
66 m_net_server.get_config_object().m_phandler =
static_cast<t_child_class*
>(
this);
73 std::sort(access_control_origins.begin(), access_control_origins.end());
78 MGINFO(
"Binding on " << bind_ip <<
":" << bind_port);
88 bool run(
size_t threads_count,
bool wait =
true)
91 MINFO(
"Run net_service loop( " << threads_count <<
" threads)...");
94 LOG_ERROR(
"Failed to run net tcp server!");
98 MINFO(
"net_service loop stopped.");
net_utils::boosted_tcp_server< net_utils::http::http_custom_handler< t_connection_context > > m_net_server
the connection templated-class for one peer connection
bool init(std::function< void(size_t, uint8_t *)> rng, const std::string &bind_port="0", const std::string &bind_ip="0.0.0.0", std::vector< std::string > access_control_origins=std::vector< std::string >(), boost::optional< net_utils::http::login > user=boost::none, net_utils::ssl_options_t ssl_options=net_utils::ssl_support_t::e_ssl_support_autodetect)
unsigned __int64 uint64_t
http_server_impl_base(boost::asio::io_service &external_io_service)
bool run(size_t threads_count, bool wait=true)
const T & move(const T &t)
long get_connections_count() const
bool timed_wait_server_stop(uint64_t ms)