Add teardown_role for correct TIME_WAIT behavior (API Change):

* teardown_tag is replaced with teardown_role, a client/server
  flag used to determine whether the shutdown is performed
  before or after reading the EOF. This is in accordance with
  RFC6455 7.1.1:

  https://tools.ietf.org/html/rfc6455#section-7.1.1

Actions Required:

* Modify signatures of teardown and async_teardown to use
  teardown_role instead of teardown_tag

* Change calls to teardown and async_teardown to pass the
  correct role: client or server depending on context.
This commit is contained in:
Vinnie Falco
2017-08-04 13:31:24 -07:00
parent de03a1a32d
commit 60c8a560bf
19 changed files with 254 additions and 157 deletions

View File

@@ -13,6 +13,7 @@
#include <boost/beast/config.hpp>
#include <boost/beast/websocket/error.hpp>
#include <boost/beast/websocket/option.hpp>
#include <boost/beast/websocket/role.hpp>
#include <boost/beast/websocket/rfc6455.hpp>
#include <boost/beast/websocket/detail/frame.hpp>
#include <boost/beast/websocket/detail/hybi13.hpp>
@@ -145,16 +146,6 @@ class stream
using control_cb_type =
std::function<void(frame_type, string_view)>;
/// Identifies the role of a WebSockets stream.
enum class role_type
{
/// Stream is operating as a client.
client,
/// Stream is operating as a server.
server
};
// State information for the message being received
//
struct rd_t