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
2017-08-04 19:02:13 -07:00
parent dc6a08d10a
commit 64327739f0
14 changed files with 1233 additions and 898 deletions
-20
View File
@@ -216,27 +216,7 @@ private:
{
if(ec)
return fail("on_close", ec);
do_drain();
}
void
do_drain()
{
ws_.async_read(buffer_,
alloc_.wrap(std::bind(
&connection::on_drain,
shared_from_this(),
ph::_1)));
}
void
on_drain(error_code ec)
{
if(ec)
return fail("on_drain", ec);
do_drain();
}
};
class timer