From 00caf76f9e19ff9284bbf3b1121485c8d58b70cf Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Wed, 24 May 2017 07:22:56 -0700 Subject: [PATCH] Fix README websocket example fix #385 --- CHANGELOG.md | 1 + README.md | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40df3ecd..88fa8b53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Version 44 * Tidy up and make get_lowest_layer public * Use BOOST_STATIC_ASSERT * Fix async return values in docs +* Fix README websocket example -------------------------------------------------------------------------------- diff --git a/README.md b/README.md index 671236a6..90851669 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ and run yourself (they are in the `examples` directory). Example WebSocket program: ```C++ -#include +#include #include #include #include @@ -178,11 +178,11 @@ int main() ws.write(boost::asio::buffer(std::string("Hello, world!"))); // Receive WebSocket message, print and close using beast - beast::streambuf sb; + beast::multi_buffer b; beast::websocket::opcode op; - ws.read(op, sb); + ws.read(op, b); ws.close(beast::websocket::close_code::normal); - std::cout << beast::to_string(sb.data()) << "\n"; + std::cout << beast::buffers(b.data()) << "\n"; } ```