Boost logo

Boost Users :

Subject: Re: [Boost-users] Why cannot asio tcp socket server detect TCP disconnection when the client device lost power?
From: jupiter (jupiter.hce_at_[hidden])
Date: 2017-06-30 00:16:07

On Thu, Jun 29, 2017 at 10:51 PM, niXman via Boost-users <
boost-users_at_[hidden]> wrote:

> You should inherit the enable_shared_from_this<your session class>, and in
> async ops in your session class you should use shared_from_this() when
> start async ops.

Yes, I did.

> For monitoring your session you should use map/any_container with
> weak_ptrs, not shared_ptrs.

Interesting, I haven't thought that, what will be the issues and
consequences to use shared_ptrs not weak_ptrs? Thanks for your advice.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at