diff --git a/src/remote/blockingTCP.h b/src/remote/blockingTCP.h index b70c758..cc14af3 100644 --- a/src/remote/blockingTCP.h +++ b/src/remote/blockingTCP.h @@ -82,9 +82,9 @@ namespace epics { int _receiveBufferSize; /** - * Beacon interval. + * Heartbeat interval. */ - float _beaconInterval; + float _heartbeatInterval; /** * Tries to connect to the given address. diff --git a/src/remote/blockingTCPConnector.cpp b/src/remote/blockingTCPConnector.cpp index 7552035..0c8ea44 100644 --- a/src/remote/blockingTCPConnector.cpp +++ b/src/remote/blockingTCPConnector.cpp @@ -24,11 +24,11 @@ namespace epics { BlockingTCPConnector::BlockingTCPConnector( Context::shared_pointer const & context, int receiveBufferSize, - float beaconInterval) : + float heartbeatInterval) : _context(context), _namedLocker(), _receiveBufferSize(receiveBufferSize), - _beaconInterval(beaconInterval) + _heartbeatInterval(heartbeatInterval) { } @@ -152,7 +152,7 @@ namespace epics { transport = detail::BlockingClientTCPTransportCodec::create( context, socket, responseHandler, _receiveBufferSize, _socketSendBufferSize, - client, transportRevision, _beaconInterval, priority); + client, transportRevision, _heartbeatInterval, priority); // verify if(!transport->verify(3000)) { diff --git a/src/remote/codec.cpp b/src/remote/codec.cpp index a67da07..80f85c1 100644 --- a/src/remote/codec.cpp +++ b/src/remote/codec.cpp @@ -1622,11 +1622,11 @@ namespace epics { int32_t receiveBufferSize, TransportClient::shared_pointer const & client, epics::pvData::int8 /*remoteTransportRevision*/, - float beaconInterval, + float heartbeatInterval, int16_t priority ) : BlockingTCPTransportCodec(false, context, channel, responseHandler, sendBufferSize, receiveBufferSize, priority), - _connectionTimeout(beaconInterval*1000), + _connectionTimeout(heartbeatInterval*1000), _unresponsiveTransport(false), _verifyOrEcho(true) { @@ -1667,7 +1667,7 @@ namespace epics { double diff = epicsTimeDiffInSeconds(¤tTime, &_aliveTimestamp); _mutex.unlock(); - if(diff>2*_connectionTimeout) { + if(diff>((3*_connectionTimeout)/2)) { unresponsiveTransport(); } // use some k (3/4) to handle "jitter" diff --git a/src/remote/codec.h b/src/remote/codec.h index 1660de8..ad48350 100644 --- a/src/remote/codec.h +++ b/src/remote/codec.h @@ -703,7 +703,7 @@ namespace epics { int32_t receiveBufferSize, TransportClient::shared_pointer const & client, epics::pvData::int8 remoteTransportRevision, - float beaconInterval, + float heartbeatInterval, int16_t priority); public: @@ -715,7 +715,7 @@ namespace epics { int32_t receiveBufferSize, TransportClient::shared_pointer const & client, int8_t remoteTransportRevision, - float beaconInterval, + float heartbeatInterval, int16_t priority ) { shared_pointer thisPointer( @@ -723,7 +723,7 @@ namespace epics { context, channel, responseHandler, sendBufferSize, receiveBufferSize, client, remoteTransportRevision, - beaconInterval, priority) + heartbeatInterval, priority) ); thisPointer->activate(); return thisPointer; diff --git a/src/remoteClient/clientContextImpl.cpp b/src/remoteClient/clientContextImpl.cpp index ff29f00..255360f 100644 --- a/src/remoteClient/clientContextImpl.cpp +++ b/src/remoteClient/clientContextImpl.cpp @@ -4100,7 +4100,7 @@ TODO osiSockAttach(); m_timer.reset(new Timer("pvAccess-client timer", lowPriority)); Context::shared_pointer thisPointer = shared_from_this(); - m_connector.reset(new BlockingTCPConnector(thisPointer, m_receiveBufferSize, m_beaconPeriod)); + m_connector.reset(new BlockingTCPConnector(thisPointer, m_receiveBufferSize, m_connectionTimeout)); m_transportRegistry.reset(new TransportRegistry()); // TODO put memory barrier here... (if not already called withing a lock?) diff --git a/src/utils/configuration.cpp b/src/utils/configuration.cpp index b9eecc0..38ce89b 100644 --- a/src/utils/configuration.cpp +++ b/src/utils/configuration.cpp @@ -274,13 +274,15 @@ bool SystemConfigurationImpl::getPropertyAsBoolean(const string &name, const boo std::transform(value.begin(), value.end(), value.begin(), ::tolower); bool isTrue = (value == "1") || (value == "true") || (value == "yes"); + if (isTrue) + return true; + bool isFalse = (value == "0") || (value == "false") || (value == "no"); + if (isFalse) + return false; // invalid value - if (!(isTrue || isFalse)) - return defaultValue; - else - return isTrue == true; + return defaultValue; } int32 SystemConfigurationImpl::getPropertyAsInteger(const string &name, const int32 defaultValue)