28#ifndef WEBSOCKETPP_SERVER_ENDPOINT_HPP
29#define WEBSOCKETPP_SERVER_ENDPOINT_HPP
43template <
typename config>
77#ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_
85#ifdef _WEBSOCKETPP_MOVE_SEMANTICS_
89#ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_
122 if (!transport_type::is_listening()) {
127 ec = lib::error_code();
130 transport_type::async_accept(
131 lib::static_pointer_cast<transport_con_type>(con),
139 con->terminate(lib::error_code());
167 "handle_accept error: "+ec.message());
170 "handle_accept error: "+ec.message());
176 lib::error_code start_ec;
180 "Stopping acceptance of new connections because the underlying transport is no longer listening.");
181 }
else if (start_ec) {
183 "Restarting async_accept loop failed: "+ec.message());
Represents an individual WebSocket connection.
lib::shared_ptr< type > ptr
Type of a shared pointer to this connection.
Creates and manages connections associated with a WebSocket endpoint.
endpoint(bool p_is_server)
connection_ptr create_connection()
Server endpoint role based on the given config.
void start_accept(lib::error_code &ec)
Starts the server's async connection acceptance loop (exception free)
transport_type::transport_con_type transport_con_type
Type of the connection transport component.
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.
connection< config > connection_type
Type of the connections this server will create.
endpoint< connection_type, config > endpoint_type
Type of the endpoint component of this server.
connection_ptr get_connection()
Create and initialize a new connection.
void handle_accept(connection_ptr con, lib::error_code const &ec)
Handler callback for start_accept.
server< config > type
Type of this endpoint.
config::concurrency_type concurrency_type
Type of the endpoint concurrency component.
void start_accept()
Starts the server's async connection acceptance loop.
connection_type::ptr connection_ptr
Type of a shared pointer to the connections this server will create.
@ async_accept_not_listening
@ operation_canceled
The requested operation was canceled.
lib::error_code make_error_code(error::value e)
Namespace for the WebSocket++ project.
static level const devel
Development messages (warning: very chatty)
static level const rerror