forked from boostorg/beast
role_type is in boost/beast/core/role.hpp (API Change):
This enumeration is now part of the library core and not specific to websocket.
This commit is contained in:
@@ -10,14 +10,14 @@
|
||||
#ifndef BOOST_BEAST_WEBSOCKET_DETAIL_IMPL_BASE_HPP
|
||||
#define BOOST_BEAST_WEBSOCKET_DETAIL_IMPL_BASE_HPP
|
||||
|
||||
#include <boost/beast/websocket/option.hpp>
|
||||
#include <boost/beast/websocket/detail/frame.hpp>
|
||||
#include <boost/beast/websocket/detail/pmd_extension.hpp>
|
||||
#include <boost/beast/core/buffer_size.hpp>
|
||||
#include <boost/beast/core/role.hpp>
|
||||
#include <boost/beast/http/empty_body.hpp>
|
||||
#include <boost/beast/http/message.hpp>
|
||||
#include <boost/beast/http/string_body.hpp>
|
||||
#include <boost/beast/websocket/option.hpp>
|
||||
#include <boost/beast/websocket/role.hpp>
|
||||
#include <boost/beast/websocket/detail/frame.hpp>
|
||||
#include <boost/beast/websocket/detail/pmd_extension.hpp>
|
||||
#include <boost/beast/zlib/deflate_stream.hpp>
|
||||
#include <boost/beast/zlib/inflate_stream.hpp>
|
||||
#include <boost/beast/core/buffers_suffix.hpp>
|
||||
|
||||
@@ -12,48 +12,24 @@
|
||||
|
||||
#include <boost/beast/core/detail/config.hpp>
|
||||
|
||||
#if ! BOOST_BEAST_ALLOW_DEPRECATED
|
||||
|
||||
#error This file is deprecated interface, #define BOOST_BEAST_ALLOW_DEPRECATED to allow it
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/beast/core/role.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace beast {
|
||||
namespace websocket {
|
||||
|
||||
/** The role of the websocket stream endpoint.
|
||||
|
||||
Whether the endpoint is a client or server affects the
|
||||
behavior of the <em>Close the WebSocket Connection</em>
|
||||
operation described in rfc6455 section 7.1.1.
|
||||
The shutdown behavior depends on the type of the next
|
||||
layer template parameter used to construct the @ref stream.
|
||||
Other next layer types including user-defined types
|
||||
may implement different role-based behavior when
|
||||
performing the close operation.
|
||||
|
||||
The default implementation for @ref stream when the next
|
||||
layer type is a `net::ip::tcp::socket` behaves
|
||||
as follows:
|
||||
|
||||
@li In the client role, a TCP/IP shutdown is sent after
|
||||
reading all remaining data on the connection.
|
||||
|
||||
@li In the server role, a TCP/IP shutdown is sent before
|
||||
reading all remaining data on the connection.
|
||||
|
||||
When the next layer type is a `net::ssl::stream`,
|
||||
the connection is closed by performing the SSL closing
|
||||
handshake corresponding to the role type, client or server.
|
||||
|
||||
@see https://tools.ietf.org/html/rfc6455#section-7.1.1
|
||||
*/
|
||||
enum class role_type
|
||||
{
|
||||
/// The stream is operating as a client.
|
||||
client,
|
||||
|
||||
/// The stream is operating as a server.
|
||||
server
|
||||
};
|
||||
using role_type = beast::role_type;
|
||||
|
||||
} // websocket
|
||||
} // beast
|
||||
} // boost
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -73,7 +73,6 @@ teardown(
|
||||
|
||||
*/
|
||||
template<class AsyncStream, class TeardownHandler>
|
||||
inline
|
||||
void
|
||||
async_teardown(
|
||||
role_type role,
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
#include <boost/beast/core/detail/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/stream_base.hpp>
|
||||
#include <boost/beast/websocket/stream_fwd.hpp>
|
||||
#include <boost/beast/websocket/detail/hybi13.hpp>
|
||||
#include <boost/beast/websocket/detail/impl_base.hpp>
|
||||
#include <boost/beast/websocket/detail/pmd_extension.hpp>
|
||||
#include <boost/beast/core/role.hpp>
|
||||
#include <boost/beast/core/stream_traits.hpp>
|
||||
#include <boost/beast/core/string.hpp>
|
||||
#include <boost/beast/core/detail/type_traits.hpp>
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#define BOOST_BEAST_WEBSOCKET_STREAM_BASE_HPP
|
||||
|
||||
#include <boost/beast/core/detail/config.hpp>
|
||||
#include <boost/beast/websocket/role.hpp>
|
||||
#include <boost/beast/websocket/detail/decorator.hpp>
|
||||
#include <boost/beast/core/role.hpp>
|
||||
#include <chrono>
|
||||
|
||||
namespace boost {
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
#include <boost/beast/core/detail/config.hpp>
|
||||
|
||||
//[code_websocket_1h
|
||||
|
||||
namespace boost {
|
||||
namespace beast {
|
||||
namespace websocket {
|
||||
@@ -25,4 +27,6 @@ class stream;
|
||||
} // beast
|
||||
} // boost
|
||||
|
||||
//]
|
||||
|
||||
#endif
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <boost/beast/core/detail/config.hpp>
|
||||
#include <boost/beast/core/error.hpp>
|
||||
#include <boost/beast/websocket/role.hpp>
|
||||
#include <boost/beast/core/role.hpp>
|
||||
#include <boost/asio/basic_stream_socket.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user