28 #ifndef WEBSOCKETPP_SERVER_ENDPOINT_HPP 29 #define WEBSOCKETPP_SERVER_ENDPOINT_HPP 43 template <
typename config>
69 explicit server() : endpoint_type(true)
77 #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ 83 #endif // _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ 85 #ifdef _WEBSOCKETPP_MOVE_SEMANTICS_ 89 #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ 92 #endif // _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ 94 #endif // _WEBSOCKETPP_MOVE_SEMANTICS_ 122 if (!transport_type::is_listening()) {
127 ec = lib::error_code();
135 transport_type::async_accept(
136 lib::static_pointer_cast<transport_con_type>(con),
144 con->terminate(lib::error_code());
172 "handle_accept error: "+ec.message());
175 "handle_accept error: "+ec.message());
181 lib::error_code start_ec;
185 "Stopping acceptance of new connections because the underlying transport is no longer listening.");
186 }
else if (start_ec) {
188 "Restarting async_accept loop failed: "+ec.message());
195 #endif //WEBSOCKETPP_SERVER_ENDPOINT_HPP
Asio based endpoint transport component.
lib::error_code make_error_code(error::value e)
config::transport_type transport_type
Type of the endpoint transport component.
transport_con_type::ptr transport_con_ptr
Type of a shared pointer to the connection transport component.
Represents an individual WebSocket connection.
config::concurrency_type concurrency_type
Type of the endpoint concurrency component.
lib::shared_ptr< alog_type > m_alog
static level const devel
Development messages (warning: very chatty)
lib::shared_ptr< elog_type > m_elog
void start_accept(lib::error_code &ec)
Starts the server's async connection acceptance loop (exception free)
Server endpoint role based on the given config.
static level const info
Information about minor configuration problems or additional information about other warnings...
Namespace for the WebSocket++ project.
The requested operation was canceled.
An async accept operation failed because the underlying transport has been requested to not listen fo...
Stub concurrency policy that implements the interface using no-ops.
Creates and manages connections associated with a WebSocket endpoint.
void handle_accept(connection_ptr con, lib::error_code const &ec)
Handler callback for start_accept.
void start_accept()
Starts the server's async connection acceptance loop.
endpoint< connection_type, config > endpoint_type
Type of the endpoint component of this server.
lib::shared_ptr< type > ptr
Type of a shared pointer to this connection.
connection_ptr get_connection()
Create and initialize a new connection.
connection< config > connection_type
Type of the connections this server will create.
connection_type::ptr connection_ptr
Type of a shared pointer to the connections this server will create.
transport_type::transport_con_type transport_con_type
Type of the connection transport component.
static level const rerror
Recoverable error.
server< config > type
Type of this endpoint.
connection_ptr create_connection()
Connection creation attempted failed.