Go to the source code of this file.
◆ client
◆ main()
int main |
( |
int | argc, |
|
|
char * | argv[] ) |
Definition at line 95 of file testee_client.cpp.
95 {
96
98
99 std::string uri = "ws://localhost:9001";
100
101 if (argc == 2) {
103 }
104
105 try {
106
109
110
111 c.init_asio();
112
113
115
116 websocketpp::lib::error_code ec;
119
120
121 c.run();
122
123 std::cout <<
"case count: " <<
case_count << std::endl;
124
126 c.reset();
127
128 std::stringstream
url;
129
130 url << uri <<
"/runCase?case=" << i <<
"&agent="
131 << websocketpp::user_agent;
132
134
136
137 c.run();
138 }
139
140 std::cout << "done" << std::endl;
141
143 std::cout << e.
what() << std::endl;
144 }
145}
connection_ptr connect(connection_ptr con)
Begin the connection process for the given connection.
connection_ptr get_connection(uri_ptr location, lib::error_code &ec)
Get a new connection.
connection_type::ptr connection_ptr
void set_message_handler(message_handler h)
void clear_access_channels(log::level channels)
Clear Access logging channels.
void clear_error_channels(log::level channels)
Clear Error logging channels.
virtual char const * what() const
static level const all
Special aggregate value representing "all levels".
static level const all
Special aggregate value representing "all levels".
void on_message(client *c, websocketpp::connection_hdl hdl, message_ptr msg)
◆ on_message()
Definition at line 83 of file testee_client.cpp.
83 {
85
86 if (con->get_resource() == "/getCaseCount") {
87 std::cout << "Detected " << msg->get_payload() << " test cases."
88 << std::endl;
90 } else {
91 c->
send(hdl, msg->get_payload(), msg->get_opcode());
92 }
93}
connection_ptr get_con_from_hdl(connection_hdl hdl, lib::error_code &ec)
Retrieves a connection_ptr from a connection_hdl (exception free)
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)
◆ case_count