Boost logo

Boost Users :

From: Gavin Lambert (boost_at_[hidden])
Date: 2019-09-10 01:53:01


On 9/09/2019 22:59, Stephan Menzel wrote:
> Well, I got both implementations (async timed connect and socks4
> handshake in place now and I do prefer the coroutine approach as it is
> much easier to read and I wanted to adapt this to more functions very soon.

FWIW, your timeout handler if-check is somewhat redundant.

You're capturing the expiry by value (as you have to -- you can't
capture it by reference since you're moving the lifetime of the timer),
which means that it will always be less than the current time, unless
the timer was aborted early due to some error other than operation_aborted.

There isn't any code that can change the expiration time seen by the
lambda callback (which the comment expresses as the reason for the check).


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