From b25c3f3ea8170e0a438f2117d5b9cb1ef96700c6 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Mon, 6 Sep 2021 12:07:43 +0200 Subject: [PATCH] Use one-shot expirations instead of intervals for the libev backend --- include/amqpcpp/libev.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/amqpcpp/libev.h b/include/amqpcpp/libev.h index 110f2511..e2dfa2ed 100644 --- a/include/amqpcpp/libev.h +++ b/include/amqpcpp/libev.h @@ -269,7 +269,7 @@ class LibEvHandler : public TcpHandler } // reset the timer to trigger again later - _timer.repeat = std::min(_next, _expire) - now; + ev_timer_set(&_timer, std::min(_next, _expire) - now, 0.0); // restart the timer ev_timer_again(_loop, &_timer); @@ -366,7 +366,7 @@ class LibEvHandler : public TcpHandler _expire = now + _timeout * 1.5; // find the earliest thing that expires - _timer.repeat = std::min(_next, _expire) - now; + ev_timer_set(&_timer, std::min(_next, _expire) - now, 0.0); // restart the timer ev_timer_again(_loop, &_timer);