62 s->
send(hdl, msg->get_payload(), msg->get_opcode());
63 }
catch (
const websocketpp::lib::error_code& e) {
64 std::cout <<
"Echo failed because: " << e
65 <<
"(" << e.message() <<
")" << std::endl;
69 int main(
int argc,
char * argv[]) {
75 if (argc > 1 && std::string(argv[1]) ==
"-d") {
87 using websocketpp::lib::placeholders::_1;
88 using websocketpp::lib::placeholders::_2;
99 }
catch (
const std::exception & e) {
100 std::cout << e.what() << std::endl;
101 }
catch (websocketpp::lib::error_code e) {
102 std::cout << e.message() << std::endl;
104 std::cout <<
"other exception" << std::endl;
static level const all
Special aggregate value representing "all levels".
int main(int argc, char *argv[])
Asio based endpoint transport component.
websocketpp::config::asio_tls_client::message_type::ptr message_ptr
static level const none
Special aggregate value representing "no levels".
permessage_compress extension
type::request_type request_type
base::response_type response_type
server::message_ptr message_ptr
connection_type::message_ptr message_ptr
Type of message pointers that this endpoint uses.
stub_config::con_msg_manager_type con_msg_manager_type
lib::weak_ptr< void > connection_hdl
A handle to uniquely identify a connection.
type::response_type response_type
websocketpp::server< deflate_config > server
This example is presently used as a scratch space.
void init_asio(io_service_ptr ptr, lib::error_code &ec)
initialize asio transport with external io_service (exception free)
base::message_type message_type
base::request_type request_type
static level const none
Special aggregate value representing "no levels".
websocketpp::transport::asio::endpoint< transport_config > transport_type
websocketpp::extensions::permessage_deflate::enabled< permessage_deflate_config > permessage_deflate_type
type::elog_type elog_type
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.
void on_message(server *s, websocketpp::connection_hdl hdl, message_ptr msg)
void set_access_channels(log::level channels)
Set Access logging channel.
base::elog_type elog_type
type::concurrency_type concurrency_type
Basic ASIO endpoint socket component.
base::alog_type alog_type
websocketpp::transport::asio::basic_socket::endpoint socket_type
base::endpoint_msg_manager_type endpoint_msg_manager_type
base::concurrency_type concurrency_type
void set_error_channels(log::level channels)
Set Error logging channel.
std::size_t run()
wraps the run method of the internal io_service object
void listen(lib::asio::ip::tcp::endpoint const &ep, lib::error_code &ec)
Set up endpoint for listening manually (exception free)
base::con_msg_manager_type con_msg_manager_type
void set_message_handler(message_handler h)
static level const all
Special aggregate value representing "all levels".
Client/Server debug config with iostream transport.
void send(connection_hdl hdl, std::string const &payload, frame::opcode::value op, lib::error_code &ec)
Create a message and add it to the outgoing send queue (exception free)
type::alog_type alog_type