Skip to content

Commit

Permalink
add custom config to testee server to allow easier tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
zaphoyd committed Oct 20, 2013
1 parent 71e6bab commit 72a3bd6
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion examples/testee_server/testee_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,43 @@
#include <websocketpp/server.hpp>
#include <iostream>

typedef websocketpp::server<websocketpp::config::asio> server;
struct testee_config : public websocketpp::config::asio {
// pull default settings from our core config
typedef websocketpp::config::asio core;

typedef core::concurrency_type concurrency_type;
typedef core::request_type request_type;
typedef core::response_type response_type;
typedef core::message_type message_type;
typedef core::con_msg_manager_type con_msg_manager_type;
typedef core::endpoint_msg_manager_type endpoint_msg_manager_type;
typedef core::alog_type alog_type;
typedef core::elog_type elog_type;
typedef core::rng_type rng_type;
typedef core::endpoint_base endpoint_base;

static bool const enable_multithreading = false;

struct transport_config : public core::transport_config {
typedef core::concurrency_type concurrency_type;
typedef core::elog_type elog_type;
typedef core::alog_type alog_type;
typedef core::request_type request_type;
typedef core::response_type response_type;

static bool const enable_multithreading = false;
};

typedef websocketpp::transport::asio::endpoint<transport_config>
transport_type;

static const websocketpp::log::level elog_level =
websocketpp::log::elevel::none;
static const websocketpp::log::level alog_level =
websocketpp::log::alevel::none;
};

typedef websocketpp::server<testee_config> server;

using websocketpp::lib::placeholders::_1;
using websocketpp::lib::placeholders::_2;
Expand Down

0 comments on commit 72a3bd6

Please sign in to comment.