WebSocket close will automatically drain (API Change):

fix #642

* Calls to stream::close and stream::async_close will
  automatically perform the required read operations

Actions Required:

* Remove calling code which drains the connection after
  calling stream::close or stream::async_close
This commit is contained in:
Vinnie Falco committed 2017-08-04 19:02:13 -07:00
1 parent dc6a08d10a
commit 64327739f0
14 files changed
+1233 -898

No files matched your search

+4 -5
View File
@@ -39,7 +39,7 @@ class stream<NextLayer>::fail_op
stream<NextLayer>& ws_;
int step_ = 0;
bool dispatched_ = false;
close_code code_;
std::uint16_t code_;
error_code ev_;
token tok_;
@@ -47,12 +47,11 @@ public:
fail_op(fail_op&&) = default;
fail_op(fail_op const&) = default;
// send close code, then teardown
template<class DeducedHandler>
fail_op(
DeducedHandler&& h,
stream<NextLayer>& ws,
close_code code,
std::uint16_t code,
error_code ev)
: h_(std::forward<DeducedHandler>(h))
, ws_(ws)
@@ -220,7 +219,7 @@ template<class NextLayer>
void
stream<NextLayer>::
do_fail(
close_code code, // if set, send a close frame first
std::uint16_t code, // if set, send a close frame first
error_code ev, // error code to use upon success
error_code& ec) // set to the error, else set to ev
{
@@ -256,7 +255,7 @@ template<class Handler>
void
stream<NextLayer>::
do_async_fail(
close_code code, // if set, send a close frame first
std::uint16_t code, // if set, send a close frame first
error_code ev, // error code to use upon success
Handler&& handler)
{