Use new move-enabled form of async_accept.

This commit is contained in:
Christopher Kohlhoff 2017-12-04 09:32:15 +11:00
parent f723043196
commit 036faf66a3

View File

@ -79,13 +79,12 @@ or:
{
private:
tcp::acceptor acceptor_;
tcp::socket socket_;
...
void handle_accept(error_code ec)
void handle_accept(error_code ec, tcp::socket socket)
{
if (!ec)
std::make_shared<connection>(std::move(socket_))->go();
acceptor_.async_accept(socket_, ...);
std::make_shared<connection>(std::move(socket))->go();
acceptor_.async_accept(...);
}
...
};