summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2005-04-07 16:31:45 +0000
committerMarc Laukien <marc@zeroc.com>2005-04-07 16:31:45 +0000
commit45f1c442774c7e85fae2d82bea2c420034865810 (patch)
treeee78e35b1178bc594ccb68f88d26e058568e1ff2 /cpp/src
parentminor edits (diff)
downloadice-45f1c442774c7e85fae2d82bea2c420034865810.tar.bz2
ice-45f1c442774c7e85fae2d82bea2c420034865810.tar.xz
ice-45f1c442774c7e85fae2d82bea2c420034865810.zip
Ice.ACM.Client, Ice.ACM.Server
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/ConnectionI.cpp4
-rw-r--r--cpp/src/Ice/Instance.cpp58
-rw-r--r--cpp/src/Ice/Instance.h8
-rw-r--r--cpp/src/Ice/PropertyNames.cpp4
-rw-r--r--cpp/src/Ice/PropertyNames.h2
5 files changed, 36 insertions, 40 deletions
diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp
index 34047945c65..b6b775e0d96 100644
--- a/cpp/src/Ice/ConnectionI.cpp
+++ b/cpp/src/Ice/ConnectionI.cpp
@@ -1401,11 +1401,11 @@ Ice::ConnectionI::ConnectionI(const InstancePtr& instance,
{
if(_adapter)
{
- acmTimeout = _instance->serverConnectionIdleTime();
+ acmTimeout = _instance->serverACM();
}
else
{
- acmTimeout = _instance->clientConnectionIdleTime();
+ acmTimeout = _instance->clientACM();
}
}
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index a3a37bac58f..9e3d2b8501c 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -342,17 +342,17 @@ IceInternal::Instance::messageSizeMax() const
}
int
-IceInternal::Instance::clientConnectionIdleTime() const
+IceInternal::Instance::clientACM() const
{
// No mutex lock, immutable.
- return _clientConnectionIdleTime;
+ return _clientACM;
}
int
-IceInternal::Instance::serverConnectionIdleTime() const
+IceInternal::Instance::serverACM() const
{
// No mutex lock, immutable.
- return _serverConnectionIdleTime;
+ return _serverACM;
}
void
@@ -394,8 +394,6 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Prope
_destroyed(false),
_properties(properties),
_messageSizeMax(0),
- _clientConnectionIdleTime(0),
- _serverConnectionIdleTime(0),
_threadPerConnection(false),
_threadPerConnectionStackSize(0)
{
@@ -558,28 +556,24 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Prope
}
{
- Int num = _properties->getPropertyAsInt("Ice.ConnectionIdleTime");
- if(num > 0)
- {
- const_cast<Int&>(_clientConnectionIdleTime) = num;
- const_cast<Int&>(_serverConnectionIdleTime) = num;
- }
- }
-
- {
- Int num = _properties->getPropertyAsIntWithDefault("Ice.ConnectionIdleTime.Client", 60);
- if(num > 0)
- {
- const_cast<Int&>(_clientConnectionIdleTime) = num;
- }
- }
-
- {
- Int num = _properties->getPropertyAsInt("Ice.ConnectionIdleTime.Server");
- if(num > 0)
+ Int clientACMDefault = 60; // Client ACM enabled by default.
+ Int serverACMDefault = 0; // Server ACM disabled by default.
+
+ //
+ // Legacy: If Ice.ConnectionIdleTime is set, we use it as
+ // default value for both the client- and server-side ACM.
+ //
+ if(!_properties->getProperty("Ice.ConnectionIdleTime").empty())
{
- const_cast<Int&>(_serverConnectionIdleTime) = num;
+ Int num = _properties->getPropertyAsInt("Ice.ConnectionIdleTime");
+ clientACMDefault = num;
+ serverACMDefault = num;
}
+
+ const_cast<Int&>(_clientACM) = _properties->getPropertyAsIntWithDefault("Ice.ACM.Client",
+ clientACMDefault);
+ const_cast<Int&>(_serverACM) = _properties->getPropertyAsIntWithDefault("Ice.ACM.Server",
+ serverACMDefault);
}
const_cast<bool&>(_threadPerConnection) = _properties->getPropertyAsInt("Ice.ThreadPerConnection") > 0;
@@ -729,17 +723,17 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[])
// Start connection monitor if necessary.
//
Int interval = 0;
- if(_clientConnectionIdleTime > 0 && _serverConnectionIdleTime > 0)
+ if(_clientACM > 0 && _serverACM > 0)
{
- interval = min(_clientConnectionIdleTime, _serverConnectionIdleTime);
+ interval = std::min(_clientACM, _serverACM);
}
- else if(_clientConnectionIdleTime > 0)
+ else if(_clientACM > 0)
{
- interval = _clientConnectionIdleTime;
+ interval = _clientACM;
}
- else if(_serverConnectionIdleTime > 0)
+ else if(_serverACM > 0)
{
- interval = _serverConnectionIdleTime;
+ interval = _serverACM;
}
interval = _properties->getPropertyAsIntWithDefault("Ice.MonitorConnections", interval);
if(interval > 0)
diff --git a/cpp/src/Ice/Instance.h b/cpp/src/Ice/Instance.h
index bfef7283dc9..2ff86dcbdbe 100644
--- a/cpp/src/Ice/Instance.h
+++ b/cpp/src/Ice/Instance.h
@@ -71,8 +71,8 @@ public:
DynamicLibraryListPtr dynamicLibraryList() const;
Ice::PluginManagerPtr pluginManager() const;
size_t messageSizeMax() const;
- Ice::Int clientConnectionIdleTime() const;
- Ice::Int serverConnectionIdleTime() const;
+ Ice::Int clientACM() const;
+ Ice::Int serverACM() const;
void flushBatchRequests();
void setDefaultContext(const ::Ice::Context&);
const ::Ice::Context& getDefaultContext() const;
@@ -92,8 +92,8 @@ private:
const TraceLevelsPtr _traceLevels; // Immutable, not reset by destroy().
const DefaultsAndOverridesPtr _defaultsAndOverrides; // Immutable, not reset by destroy().
const size_t _messageSizeMax; // Immutable, not reset by destroy().
- const Ice::Int _clientConnectionIdleTime; // Immutable, not reset by destroy().
- const Ice::Int _serverConnectionIdleTime; // Immutable, not reset by destroy().
+ const Ice::Int _clientACM; // Immutable, not reset by destroy().
+ const Ice::Int _serverACM; // Immutable, not reset by destroy().
RouterManagerPtr _routerManager;
LocatorManagerPtr _locatorManager;
ReferenceFactoryPtr _referenceFactory;
diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp
index 6b302897326..d22317421a3 100644
--- a/cpp/src/Ice/PropertyNames.cpp
+++ b/cpp/src/Ice/PropertyNames.cpp
@@ -7,7 +7,7 @@
//
// **********************************************************************
-// Generated by makeprops.py from file `../config/PropertyNames.def', Wed Apr 6 18:27:30 2005
+// Generated by makeprops.py from file `../config/PropertyNames.def', Thu Apr 7 12:39:58 2005
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
@@ -15,6 +15,8 @@
const char* IceInternal::PropertyNames::IceProps[] =
{
+ "Ice.ACM.Client",
+ "Ice.ACM.Server",
"Ice.ChangeUser",
"Ice.Config",
"Ice.ConnectionIdleTime",
diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h
index 127dc85a7be..047b182a8b0 100644
--- a/cpp/src/Ice/PropertyNames.h
+++ b/cpp/src/Ice/PropertyNames.h
@@ -7,7 +7,7 @@
//
// **********************************************************************
-// Generated by makeprops.py from file `../config/PropertyNames.def', Wed Apr 6 18:27:30 2005
+// Generated by makeprops.py from file `../config/PropertyNames.def', Thu Apr 7 12:39:58 2005
// IMPORTANT: Do not edit this file -- any edits made here will be lost!