client now uses connection timeout param
This commit is contained in:
@@ -82,9 +82,9 @@ namespace epics {
|
||||
int _receiveBufferSize;
|
||||
|
||||
/**
|
||||
* Beacon interval.
|
||||
* Heartbeat interval.
|
||||
*/
|
||||
float _beaconInterval;
|
||||
float _heartbeatInterval;
|
||||
|
||||
/**
|
||||
* Tries to connect to the given address.
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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"
|
||||
|
||||
+3
-3
@@ -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;
|
||||
|
||||
@@ -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?)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user