diff options
| author | Alan Conway <aconway@apache.org> | 2013-04-19 02:00:16 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2013-04-19 02:00:16 +0000 |
| commit | cf171ceead7d5395135625567b188808600d076e (patch) | |
| tree | d4eaab184da2b040884872dd65c3fbdc19a8a8f9 /cpp/src/qpid/broker/ConnectionHandler.cpp | |
| parent | de62dddc069e223caf346c5ebadfec902c69dac6 (diff) | |
| download | qpid-python-cf171ceead7d5395135625567b188808600d076e.tar.gz | |
QPID-4748: Consistent handling of durations in broker configuration, allowing sub-second intervals.
Provides string conversion for sys::Duration, allowing intervals to be expressed like this:
10.5 - value in seconds, backward compatible.
10.5s - value in seconds
10.5ms - value in milliseconds
10.5us - value in microseconds
10.5ns - value in nanoseconds
Converted the folllowing broker options to Duration:
mgmtPubInterval, queueCleanInterval, linkMaintenanceInterval, linkHeartbeatInterval
Did not convert: maxNegotiateTime. This is expressed in milliseconds so it would not be
backward compatible to make it a Duration.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1469661 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/ConnectionHandler.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/ConnectionHandler.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/ConnectionHandler.cpp b/cpp/src/qpid/broker/ConnectionHandler.cpp index 977c706ebd..ac05178fce 100644 --- a/cpp/src/qpid/broker/ConnectionHandler.cpp +++ b/cpp/src/qpid/broker/ConnectionHandler.cpp @@ -34,6 +34,7 @@ #include "qpid/log/Statement.h" #include "qpid/management/ManagementAgent.h" #include "qpid/sys/SecurityLayer.h" +#include "qpid/sys/Time.h" #include "qpid/broker/AclModule.h" #include "qpid/amqp_0_10/Codecs.h" #include "qmf/org/apache/qpid/broker/EventClientConnectFail.h" @@ -401,7 +402,9 @@ void ConnectionHandler::Handler::tune(uint16_t channelMax, // this method is only ever called when this Connection // is a federation link where this Broker is acting as // a client to another Broker - uint16_t hb = std::min(connection.getBroker().getOptions().linkHeartbeatInterval, heartbeatMax); + sys::Duration interval = connection.getBroker().getOptions().linkHeartbeatInterval; + uint16_t intervalSec = static_cast<uint16_t>(interval/sys::TIME_SEC); + uint16_t hb = std::min(intervalSec, heartbeatMax); connection.setHeartbeat(hb); connection.startLinkHeartbeatTimeoutTask(); |
