mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 12:12:15 +02:00
AsioTimer: use expires_after() method when possible.
A common AsioTimer usage pattern is: expires_at(Time::now() + duration) This is more succinctly and efficiently stated as: expires_after(duration). Signed-off-by: James Yonan <james@openvpn.net>
This commit is contained in:
parent
d3da69e35c
commit
35c0480180
@ -632,7 +632,7 @@ namespace openvpn {
|
||||
|
||||
void stop_omi_client(const bool eof, const unsigned int milliseconds)
|
||||
{
|
||||
stop_timer.expires_at(Time::now() + Time::Duration::milliseconds(milliseconds));
|
||||
stop_timer.expires_after(Time::Duration::milliseconds(milliseconds));
|
||||
stop_timer.async_wait([self=Ptr(this), eof](const openvpn_io::error_code& error)
|
||||
{
|
||||
if (!error)
|
||||
|
Loading…
Reference in New Issue
Block a user