|
Boost Users : |
Subject: Re: [Boost-users] Why cannot asio tcp socket server detect TCP disconnection when the client device lost power?
From: Joe Steeve (js_at_[hidden])
Date: 2017-07-03 18:33:56
On Thu, 2017-06-29 at 15:51 +0300, niXman via Boost-users wrote:
> For monitoring your session you should use map/any_container with
> weak_ptrs, not shared_ptrs.
Especially with networking code, I'd refrain from this. Though it
offers a lot of loose coupling, it makes readability difficult. For
session bring-down, I always prefer explicit "unregister()" style
messages between objects. That way, the "disconnect behaviour" is
explicitly embedded in code.
IMHO, of course :D
-- Joe Steeve HiPro IT Solutions Private Limited http://www.hipro.co.in/
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net