Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
connection_tu2.hpp File Reference
#include <iostream>
#include <sstream>
#include <websocketpp/config/debug.hpp>
#include <websocketpp/config/core.hpp>
#include <websocketpp/server.hpp>
#include <websocketpp/client.hpp>
Include dependency graph for connection_tu2.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef websocketpp::server< websocketpp::config::coreserver
 
typedef websocketpp::client< websocketpp::config::coreclient
 
typedef websocketpp::config::core::message_type::ptr message_ptr
 

Functions

void echo_func (server *s, websocketpp::connection_hdl hdl, message_ptr msg)
 
std::string run_server_test (std::string input, bool log=false)
 
std::string run_server_test (server &s, std::string input, bool log=false)
 

Typedef Documentation

◆ client

NOTE: the "server" config is being used for the client here because we don't want to pull in the real RNG. A better way to do this might be a custom client config with the RNG explicitly stubbed out.

Definition at line 42 of file connection_tu2.hpp.

◆ message_ptr

◆ server

Function Documentation

◆ echo_func()

void echo_func ( server * s,
websocketpp::connection_hdl hdl,
message_ptr msg )

Definition at line 30 of file connection_tu2.cpp.

30 {
31 s->send(hdl, msg->get_payload(), msg->get_opcode());
32}
char * s
Here is the caller graph for this function:

◆ run_server_test() [1/2]

std::string run_server_test ( server & s,
std::string input,
bool log = false )

Definition at line 39 of file connection_tu2.cpp.

39 {
41 std::stringstream output;
42
43 if (log) {
44 s.set_access_channels(websocketpp::log::alevel::all);
45 s.set_error_channels(websocketpp::log::elevel::all);
46 } else {
47 s.clear_access_channels(websocketpp::log::alevel::all);
48 s.clear_error_channels(websocketpp::log::elevel::all);
49 }
50
51 s.register_ostream(&output);
52
53 con = s.get_connection();
54 con->start();
55
56 std::stringstream channel;
57
58 channel << input;
59 channel >> *con;
60
61 return output.str();
62}
static level const all
Special aggregate value representing "all levels".
Definition levels.hpp:152
static level const all
Special aggregate value representing "all levels".
Definition levels.hpp:80

◆ run_server_test() [2/2]

std::string run_server_test ( std::string input,
bool log = false )

Definition at line 34 of file connection_tu2.cpp.

34 {
35 server test_server;
36 return run_server_test(test_server,input,log);
37}
std::string run_server_test(std::string input, bool log)
Here is the call graph for this function:
Here is the caller graph for this function: