|
| Server (Handler *handler, std::string bindaddr, uint16_t port, std::string server_name=std::string("Crow/")+VERSION, std::tuple< Middlewares... > *middlewares=nullptr, uint16_t concurrency=1, uint8_t timeout=5, typename Adaptor::context *adaptor_ctx=nullptr) |
|
void | set_tick_function (std::chrono::milliseconds d, std::function< void()> f) |
|
void | on_tick () |
|
void | run () |
|
void | stop () |
|
void | signal_clear () |
|
void | signal_add (int signal_number) |
|
◆ Server()
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
crow::Server< Handler, Adaptor, Middlewares >::Server |
( |
Handler * |
handler, |
|
|
std::string |
bindaddr, |
|
|
uint16_t |
port, |
|
|
std::string |
server_name = std::string("Crow/") + VERSION , |
|
|
std::tuple< Middlewares... > * |
middlewares = nullptr , |
|
|
uint16_t |
concurrency = 1 , |
|
|
uint8_t |
timeout = 5 , |
|
|
typename Adaptor::context * |
adaptor_ctx = nullptr |
|
) |
| |
|
inline |
◆ set_tick_function()
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
void crow::Server< Handler, Adaptor, Middlewares >::set_tick_function |
( |
std::chrono::milliseconds |
d, |
|
|
std::function< void()> |
f |
|
) |
| |
|
inline |
◆ on_tick()
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
void crow::Server< Handler, Adaptor, Middlewares >::on_tick |
( |
| ) |
|
|
inline |
◆ run()
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
◆ stop()
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
void crow::Server< Handler, Adaptor, Middlewares >::stop |
( |
| ) |
|
|
inline |
◆ signal_clear()
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
void crow::Server< Handler, Adaptor, Middlewares >::signal_clear |
( |
| ) |
|
|
inline |
◆ signal_add()
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
void crow::Server< Handler, Adaptor, Middlewares >::signal_add |
( |
int |
signal_number | ) |
|
|
inline |
◆ pick_io_service_idx()
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
uint16_t crow::Server< Handler, Adaptor, Middlewares >::pick_io_service_idx |
( |
| ) |
|
|
inlineprivate |
◆ do_accept()
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
void crow::Server< Handler, Adaptor, Middlewares >::do_accept |
( |
| ) |
|
|
inlineprivate |
◆ io_service_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
asio::io_service crow::Server< Handler, Adaptor, Middlewares >::io_service_ |
|
private |
◆ io_service_pool_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
std::vector<std::unique_ptr<asio::io_service> > crow::Server< Handler, Adaptor, Middlewares >::io_service_pool_ |
|
private |
◆ task_timer_pool_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
◆ get_cached_date_str_pool_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
std::vector<std::function<std::string()> > crow::Server< Handler, Adaptor, Middlewares >::get_cached_date_str_pool_ |
|
private |
◆ acceptor_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
tcp::acceptor crow::Server< Handler, Adaptor, Middlewares >::acceptor_ |
|
private |
◆ signals_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
boost::asio::signal_set crow::Server< Handler, Adaptor, Middlewares >::signals_ |
|
private |
◆ tick_timer_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
boost::asio::deadline_timer crow::Server< Handler, Adaptor, Middlewares >::tick_timer_ |
|
private |
◆ handler_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
Handler* crow::Server< Handler, Adaptor, Middlewares >::handler_ |
|
private |
◆ concurrency_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
uint16_t crow::Server< Handler, Adaptor, Middlewares >::concurrency_ {2} |
|
private |
◆ timeout_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
std::uint8_t crow::Server< Handler, Adaptor, Middlewares >::timeout_ |
|
private |
◆ server_name_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
std::string crow::Server< Handler, Adaptor, Middlewares >::server_name_ |
|
private |
◆ port_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
uint16_t crow::Server< Handler, Adaptor, Middlewares >::port_ |
|
private |
◆ bindaddr_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
std::string crow::Server< Handler, Adaptor, Middlewares >::bindaddr_ |
|
private |
◆ task_queue_length_pool_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
std::vector<std::atomic<unsigned int> > crow::Server< Handler, Adaptor, Middlewares >::task_queue_length_pool_ |
|
private |
◆ tick_interval_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
std::chrono::milliseconds crow::Server< Handler, Adaptor, Middlewares >::tick_interval_ |
|
private |
◆ tick_function_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
std::function<void()> crow::Server< Handler, Adaptor, Middlewares >::tick_function_ |
|
private |
◆ middlewares_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
std::tuple<Middlewares...>* crow::Server< Handler, Adaptor, Middlewares >::middlewares_ |
|
private |
◆ adaptor_ctx_
template<typename Handler , typename Adaptor = SocketAdaptor, typename... Middlewares>
Adaptor::context* crow::Server< Handler, Adaptor, Middlewares >::adaptor_ctx_ |
|
private |
The documentation for this class was generated from the following file: