28 #ifndef WEBSOCKETPP_ENDPOINT_HPP
29 #define WEBSOCKETPP_ENDPOINT_HPP
31 #include <websocketpp/connection.hpp>
33 #include <websocketpp/logger/levels.hpp>
34 #include <websocketpp/version.hpp>
41 template <
typename connection,
typename config>
42 class endpoint :
public config::transport_type,
public config::endpoint_base {
46 typedef endpoint<connection,config> type;
86 typedef typename connection_type::termination_handler termination_handler;
91 explicit endpoint(
bool p_is_server)
94 , m_user_agent(::websocketpp::user_agent)
95 , m_open_handshake_timeout_dur(config::timeout_open_handshake)
96 , m_close_handshake_timeout_dur(config::timeout_close_handshake)
97 , m_pong_timeout_dur(config::timeout_pong)
98 , m_max_message_size(config::max_message_size)
99 , m_max_http_body_size(config::max_http_body_size)
100 , m_is_server(p_is_server)
102 m_alog->set_channels(config::alog_level);
103 m_elog->set_channels(config::elog_level);
112 ~endpoint<connection,config>() {}
114 #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_
122 #ifdef _WEBSOCKETPP_MOVE_SEMANTICS_
125 : config::transport_type(std::move(o))
126 , config::endpoint_base(std::move(o))
127 , m_alog(std::move(o.m_alog))
128 , m_elog(std::move(o.m_elog))
129 , m_user_agent(std::move(o.m_user_agent))
130 , m_open_handler(std::move(o.m_open_handler))
132 , m_close_handler(std::move(o.m_close_handler))
133 , m_fail_handler(std::move(o.m_fail_handler))
134 , m_ping_handler(std::move(o.m_ping_handler))
135 , m_pong_handler(std::move(o.m_pong_handler))
136 , m_pong_timeout_handler(std::move(o.m_pong_timeout_handler))
137 , m_interrupt_handler(std::move(o.m_interrupt_handler))
138 , m_http_handler(std::move(o.m_http_handler))
139 , m_validate_handler(std::move(o.m_validate_handler))
140 , m_message_handler(std::move(o.m_message_handler))
142 , m_open_handshake_timeout_dur(o.m_open_handshake_timeout_dur)
143 , m_close_handshake_timeout_dur(o.m_close_handshake_timeout_dur)
144 , m_pong_timeout_dur(o.m_pong_timeout_dur)
145 , m_max_message_size(o.m_max_message_size)
146 , m_max_http_body_size(o.m_max_http_body_size)
148 , m_rng(std::move(o.m_rng))
149 , m_is_server(o.m_is_server)
152 #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_
221 m_alog->set_channels(channels);
232 m_alog->clear_channels(channels);
243 m_elog->set_channels(channels);
254 m_elog->clear_channels(channels);
305 m_pong_timeout_handler = h;
310 m_interrupt_handler = h;
320 m_validate_handler = h;
325 m_message_handler = h;
354 m_open_handshake_timeout_dur = dur;
379 m_close_handshake_timeout_dur = dur;
401 m_pong_timeout_dur = dur;
416 return m_max_message_size;
433 m_max_message_size = new_value;
450 return m_max_http_body_size;
467 m_max_http_body_size = new_value;
583 std::string
const & reason, lib::error_code & ec);
585 std::string
const & reason);
596 lib::error_code & ec);
617 lib::error_code & ec);
668 std::string m_user_agent;
681 long m_open_handshake_timeout_dur;
682 long m_close_handshake_timeout_dur;
683 long m_pong_timeout_dur;
684 size_t m_max_message_size;
685 size_t m_max_http_body_size;
690 bool const m_is_server;
698 #include <websocketpp/impl/endpoint_impl.hpp>