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: private:
tcp::acceptor acceptor_; tcp::acceptor acceptor_;
tcp::socket socket_;
... ...
void handle_accept(error_code ec) void handle_accept(error_code ec, tcp::socket socket)
{ {
if (!ec) if (!ec)
std::make_shared<connection>(std::move(socket_))->go(); std::make_shared<connection>(std::move(socket))->go();
acceptor_.async_accept(socket_, ...); acceptor_.async_accept(...);
} }
... ...
}; };