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