mirror of
https://github.com/boostorg/beast.git
synced 2025-07-31 21:34:46 +02:00
example/cppcon2018 only requires C++11
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
Version 190:
|
||||
|
||||
* Fix broken doc link
|
||||
* example/cppcon2018 only requires C++11
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@@ -203,11 +203,11 @@ run()
|
||||
{
|
||||
// Read a request
|
||||
http::async_read(socket_, buffer_, req_,
|
||||
[self = shared_from_this()]
|
||||
(error_code ec, std::size_t bytes)
|
||||
{
|
||||
self->on_read(ec, bytes);
|
||||
});
|
||||
std::bind(
|
||||
&http_session::on_read,
|
||||
shared_from_this(),
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2));
|
||||
}
|
||||
|
||||
// Report a failure
|
||||
@@ -341,9 +341,9 @@ on_write(error_code ec, std::size_t, bool close)
|
||||
|
||||
// Read another request
|
||||
http::async_read(socket_, buffer_, req_,
|
||||
[self = shared_from_this()]
|
||||
(error_code ec, std::size_t bytes)
|
||||
{
|
||||
self->on_read(ec, bytes);
|
||||
});
|
||||
std::bind(
|
||||
&http_session::on_read,
|
||||
shared_from_this(),
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2));
|
||||
}
|
||||
|
@@ -63,10 +63,10 @@ run()
|
||||
// Start accepting a connection
|
||||
acceptor_.async_accept(
|
||||
socket_,
|
||||
[self = shared_from_this()](error_code ec)
|
||||
{
|
||||
self->on_accept(ec);
|
||||
});
|
||||
std::bind(
|
||||
&listener::on_accept,
|
||||
shared_from_this(),
|
||||
std::placeholders::_1));
|
||||
}
|
||||
|
||||
// Report a failure
|
||||
@@ -96,8 +96,8 @@ on_accept(error_code ec)
|
||||
// Accept another connection
|
||||
acceptor_.async_accept(
|
||||
socket_,
|
||||
[self = shared_from_this()](error_code ec)
|
||||
{
|
||||
self->on_accept(ec);
|
||||
});
|
||||
std::bind(
|
||||
&listener::on_accept,
|
||||
shared_from_this(),
|
||||
std::placeholders::_1));
|
||||
}
|
||||
|
@@ -51,11 +51,11 @@ on_accept(error_code ec)
|
||||
// Read a message
|
||||
ws_.async_read(
|
||||
buffer_,
|
||||
[sp = shared_from_this()](
|
||||
error_code ec, std::size_t bytes)
|
||||
{
|
||||
sp->on_read(ec, bytes);
|
||||
});
|
||||
std::bind(
|
||||
&websocket_session::on_read,
|
||||
shared_from_this(),
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -75,11 +75,11 @@ on_read(error_code ec, std::size_t)
|
||||
// Read another message
|
||||
ws_.async_read(
|
||||
buffer_,
|
||||
[sp = shared_from_this()](
|
||||
error_code ec, std::size_t bytes)
|
||||
{
|
||||
sp->on_read(ec, bytes);
|
||||
});
|
||||
std::bind(
|
||||
&websocket_session::on_read,
|
||||
shared_from_this(),
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -96,11 +96,11 @@ send(std::shared_ptr<std::string const> const& ss)
|
||||
// We are not currently writing, so send this immediately
|
||||
ws_.async_write(
|
||||
net::buffer(*queue_.front()),
|
||||
[sp = shared_from_this()](
|
||||
error_code ec, std::size_t bytes)
|
||||
{
|
||||
sp->on_write(ec, bytes);
|
||||
});
|
||||
std::bind(
|
||||
&websocket_session::on_write,
|
||||
shared_from_this(),
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -118,9 +118,9 @@ on_write(error_code ec, std::size_t)
|
||||
if(! queue_.empty())
|
||||
ws_.async_write(
|
||||
net::buffer(*queue_.front()),
|
||||
[sp = shared_from_this()](
|
||||
error_code ec, std::size_t bytes)
|
||||
{
|
||||
sp->on_write(ec, bytes);
|
||||
});
|
||||
std::bind(
|
||||
&websocket_session::on_write,
|
||||
shared_from_this(),
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2));
|
||||
}
|
||||
|
Reference in New Issue
Block a user