capture websocket session as shared_ptr (#99)

* capture websocket session as shared_ptr
This commit is contained in:
Nathan Nichols
2022-02-18 16:40:13 -06:00
committed by GitHub
parent d016253264
commit 6567a5cc7d

View File

@@ -315,8 +315,9 @@ public:
{
boost::asio::spawn(
ioc_,
[m = std::move(msg), this](boost::asio::yield_context yc) {
handle_request(std::move(m), yc);
[m = std::move(msg), shared_this = shared_from_this()](
boost::asio::yield_context yield) {
shared_this->handle_request(std::move(m), yield);
});
}