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,18 +10,17 @@
|
||||
#include <boost/beast/core.hpp>
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/asio/spawn.hpp>
|
||||
#include <boost/asio/ssl.hpp>
|
||||
#include <boost/asio/use_future.hpp>
|
||||
#include <algorithm>
|
||||
#include <future>
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
|
||||
//[ws_snippet_1
|
||||
using namespace boost::beast;
|
||||
|
||||
#include <boost/beast/websocket.hpp>
|
||||
using namespace boost::beast::websocket;
|
||||
//]
|
||||
|
||||
using namespace boost::beast;
|
||||
|
||||
namespace doc_ws_snippets {
|
||||
|
||||
@@ -34,12 +33,6 @@ error_code ec;
|
||||
net::ip::tcp::socket sock{ioc};
|
||||
boost::ignore_unused(ec);
|
||||
|
||||
{
|
||||
//[ws_snippet_2
|
||||
stream<net::ip::tcp::socket> ws{ioc};
|
||||
//]
|
||||
}
|
||||
|
||||
{
|
||||
//[ws_snippet_3
|
||||
stream<net::ip::tcp::socket> ws{std::move(sock)};
|
||||
@@ -277,25 +270,10 @@ struct custom_wrapper
|
||||
|
||||
//]
|
||||
|
||||
//[ws_snippet_26
|
||||
|
||||
// A WebSocket stream
|
||||
template<
|
||||
class NextLayer,
|
||||
bool deflateSupported = true>
|
||||
class stream;
|
||||
|
||||
//]
|
||||
|
||||
} // doc_ws_snippets
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//[wss_snippet_1
|
||||
#include <boost/beast/websocket/ssl.hpp>
|
||||
#include <boost/asio/ssl.hpp>
|
||||
//]
|
||||
|
||||
namespace doc_wss_snippets {
|
||||
|
||||
void fxx() {
|
||||
@@ -306,13 +284,6 @@ std::thread t{[&](){ ioc.run(); }};
|
||||
error_code ec;
|
||||
net::ip::tcp::socket sock{ioc};
|
||||
|
||||
{
|
||||
//[wss_snippet_2
|
||||
net::ssl::context ctx{net::ssl::context::sslv23};
|
||||
stream<net::ssl::stream<net::ip::tcp::socket>> wss{ioc, ctx};
|
||||
//]
|
||||
}
|
||||
|
||||
{
|
||||
//[wss_snippet_3
|
||||
net::ip::tcp::endpoint ep;
|
||||
|
||||
Reference in New Issue
Block a user