From 5a853134aae2b26cc36618c641bcf655e1cb3448 Mon Sep 17 00:00:00 2001 From: Steven Geddis Date: Thu, 1 Feb 2018 15:27:59 +0100 Subject: [PATCH] remove second ctor with heartbeat interval (extend class instead). Change private to protected to allow LibBoostAsioHandler to be extended. --- include/amqpcpp/libboostasio.h | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/include/amqpcpp/libboostasio.h b/include/amqpcpp/libboostasio.h index 56f73d4..9c09645 100644 --- a/include/amqpcpp/libboostasio.h +++ b/include/amqpcpp/libboostasio.h @@ -47,7 +47,7 @@ namespace AMQP { */ class LibBoostAsioHandler : public virtual TcpHandler { -private: +protected: /** * Helper class that wraps a boost io_service socket monitor. @@ -477,12 +477,6 @@ private: */ std::shared_ptr _timer; - /** - * The heartbeat timer interval (in seconds). - * @var uint16_t - */ - uint16_t _timer_interval; - /** * Method that is called by AMQP-CPP to register a filedescriptor for readability or writability * @param connection The TCP connection object that is reporting @@ -535,9 +529,6 @@ protected: // skip if no heartbeats are needed if (interval == 0) return 0; - // choose heartbeat interval to use (user-specified or rabbit server default). - interval = (_timer_interval > 0) ? _timer_interval : interval; - // set the timer _timer->set(connection, interval); @@ -567,20 +558,6 @@ public: } - /** - * Constructor - * @param io_service The boost io_service to wrap - * @param interval The interval to use when negotiating heartbeat with rabbit server. - */ - explicit LibBoostAsioHandler(boost::asio::io_service &io_service, uint16_t interval) : - _ioservice(io_service), - _strand(std::make_shared(_ioservice)), - _timer(std::make_shared(_ioservice,_strand)), - _timer_interval(interval) - { - - } - /** * Handler cannot be copied or moved *