Use new move-enabled form of async_accept.
This commit is contained in:
parent
f723043196
commit
036faf66a3
@ -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(...);
|
||||||
}
|
}
|
||||||
...
|
...
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user