add transport integration helper handlers delay and close

This commit is contained in:
Peter Thorson
2013-06-09 07:34:10 -05:00
parent b9c66e9a7f
commit 0ab1333a2f

View File

@@ -203,6 +203,10 @@ void fail_on_open(websocketpp::connection_hdl hdl) {
BOOST_FAIL( "expected no open handler" );
}
void delay(websocketpp::connection_hdl hdl, long duration) {
sleep(duration);
}
template <typename T>
void check_ec(T * c, websocketpp::lib::error_code ec,
websocketpp::connection_hdl hdl)
@@ -233,6 +237,11 @@ void req_pong_timeout(T * c, std::string expected_payload,
con->close(websocketpp::close::status::normal,"");
}
template <typename T>
void close(T * e, websocketpp::connection_hdl hdl) {
e->get_con_from_hdl(hdl)->close(websocketpp::close::status::normal,"");
}
// Wait for the specified time period then fail the test
void run_test_timer(long value) {
sleep(value);