websocket ping tests

This commit is contained in:
Vinnie Falco
2017-08-19 19:39:54 -07:00
parent 6809c18afa
commit 99822aebf5
4 changed files with 337 additions and 203 deletions
@@ -45,6 +45,7 @@ template<class... Args>
stream<NextLayer>::
stream(Args&&... args)
: stream_(std::forward<Args>(args)...)
, t_(1)
{
BOOST_ASSERT(rd_.buf.max_size() >=
max_control_frame_size);
+3 -3
View File
@@ -131,11 +131,11 @@ class stream
// tokens are used to order reads and writes
class token
{
unsigned char id_ = 1;
explicit token(unsigned char id) : id_(id) {}
unsigned char id_ = 0;
public:
token() = default;
token(token const&) = default;
explicit token(unsigned char id) : id_(id) {}
operator bool() const { return id_ != 0; }
bool operator==(token const& t) { return id_ == t.id_; }
bool operator!=(token const& t) { return id_ != t.id_; }
@@ -225,7 +225,7 @@ class stream
detail::opcode::text; // outgoing message type
control_cb_type ctrl_cb_; // control callback
role_type role_; // server or client
bool failed_; // the connection failed
bool failed_ = true; // the connection failed
bool rd_close_; // read close frame
bool wr_close_; // sent close frame