예제 #1
0
/* Run server and return output test rig */
std::string run_server_test(server& s, std::string input) {
    server::connection_ptr con;
    std::stringstream output;
	
	s.register_ostream(&output);
	s.clear_access_channels(websocketpp::log::alevel::all);
    s.clear_error_channels(websocketpp::log::elevel::all);
	
	con = s.get_connection();
	con->start();
	
	std::stringstream channel;
	
	channel << input;
	channel >> *con;
	
	return output.str();
}