Examples use bind_front_handler

This commit is contained in:
Vinnie Falco
2019-02-14 16:20:27 -08:00
parent 92add2afa6
commit 18447553ca
26 changed files with 248 additions and 397 deletions

View File

@@ -60,10 +60,9 @@ public:
{
// Accept the websocket handshake
ws_.async_accept(
std::bind(
beast::bind_front_handler(
&session::on_accept,
shared_from_this(),
std::placeholders::_1));
shared_from_this()));
}
void
@@ -82,11 +81,9 @@ public:
// Read a message into our buffer
ws_.async_read(
buffer_,
std::bind(
beast::bind_front_handler(
&session::on_read,
shared_from_this(),
std::placeholders::_1,
std::placeholders::_2));
shared_from_this()));
}
void
@@ -107,11 +104,9 @@ public:
ws_.text(ws_.got_text());
ws_.async_write(
buffer_.data(),
std::bind(
beast::bind_front_handler(
&session::on_write,
shared_from_this(),
std::placeholders::_1,
std::placeholders::_2));
shared_from_this()));
}
void
@@ -194,11 +189,9 @@ public:
do_accept()
{
acceptor_.async_accept(
std::bind(
beast::bind_front_handler(
&listener::on_accept,
shared_from_this(),
std::placeholders::_1,
std::placeholders::_2));
shared_from_this()));
}
void