diff options
author | Marc Laukien <marc@zeroc.com> | 2003-11-22 13:15:01 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2003-11-22 13:15:01 +0000 |
commit | c74eb088ca6fa8706a7a34cf305b89d852bef736 (patch) | |
tree | 3a0ae5334424611f8295661a672219f6213441aa /cpp | |
parent | - Bug fix for class transforms. Only the transform for the formal type was (diff) | |
download | ice-c74eb088ca6fa8706a7a34cf305b89d852bef736.tar.bz2 ice-c74eb088ca6fa8706a7a34cf305b89d852bef736.tar.xz ice-c74eb088ca6fa8706a7a34cf305b89d852bef736.zip |
added Ice.Override.ConnectTimeout
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/CHANGES | 3 | ||||
-rw-r--r-- | cpp/doc/Properties.sgml | 17 | ||||
-rw-r--r-- | cpp/src/Ice/ConnectionFactory.cpp | 17 | ||||
-rw-r--r-- | cpp/src/Ice/DefaultsAndOverrides.cpp | 9 | ||||
-rw-r--r-- | cpp/src/Ice/DefaultsAndOverrides.h | 2 | ||||
-rw-r--r-- | cpp/src/Ice/PropertiesI.cpp | 1 |
6 files changed, 48 insertions, 1 deletions
diff --git a/cpp/CHANGES b/cpp/CHANGES index f083ba21067..649c1ac93c2 100644 --- a/cpp/CHANGES +++ b/cpp/CHANGES @@ -1,6 +1,9 @@ Changes since version 1.2.0 --------------------------- +- Added property Ice.Override.ConnectTimeout. See the manual for + details. + - Fixed a rare deadlock in the object adapter, when a locator was used. diff --git a/cpp/doc/Properties.sgml b/cpp/doc/Properties.sgml index c87945bd8ae..39dba9d44da 100644 --- a/cpp/doc/Properties.sgml +++ b/cpp/doc/Properties.sgml @@ -667,6 +667,23 @@ milliseconds, or -1 for no timeout. </section> </section> +<section><title>Ice.Override.ConnectTimeout</title> +<section><title>Synopsis</title> +<synopsis> +Ice.Override.ConnectTimeout=<replaceable>num</replaceable> +</synopsis> +</section> +<section> +<title>Description</title> +<para> +This property overrides timeout settings used to establish +connections. <replaceable>num</replaceable> is the timeout value in +milliseconds, or -1 for no timeout. If this property is not set, then +<literal>Ice.Override.Timeout</literal> is used. +</para> +</section> +</section> + <section><title>Ice.Override.Compress</title> <section><title>Synopsis</title> <synopsis> diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp index 55a013f0f22..f43d6fe65c8 100644 --- a/cpp/src/Ice/ConnectionFactory.cpp +++ b/cpp/src/Ice/ConnectionFactory.cpp @@ -251,7 +251,22 @@ IceInternal::OutgoingConnectionFactory::create(const vector<EndpointPtr>& endpts { ConnectorPtr connector = endpoint->connector(); assert(connector); - transceiver = connector->connect(endpoint->timeout()); + + Int timeout; + DefaultsAndOverridesPtr defaultsAndOverrides = _instance->defaultsAndOverrides(); + if(defaultsAndOverrides->overrideConnectTimeout) + { + timeout = defaultsAndOverrides->overrideConnectTimeoutValue; + } + // It is not necessary to check for overrideTimeout, + // the endpoint has already been modified with this + // override, if set. + else + { + timeout = endpoint->timeout(); + } + + transceiver = connector->connect(timeout); assert(transceiver); } connection = new Connection(_instance, transceiver, endpoint, 0); diff --git a/cpp/src/Ice/DefaultsAndOverrides.cpp b/cpp/src/Ice/DefaultsAndOverrides.cpp index ef9719dbc99..815bebb5a9a 100644 --- a/cpp/src/Ice/DefaultsAndOverrides.cpp +++ b/cpp/src/Ice/DefaultsAndOverrides.cpp @@ -26,6 +26,8 @@ void IceInternal::decRef(DefaultsAndOverrides* p) { p->__decRef(); } IceInternal::DefaultsAndOverrides::DefaultsAndOverrides(const PropertiesPtr& properties) : overrideTimeout(false), overrideTimeoutValue(-1), + overrideConnectTimeout(false), + overrideConnectTimeoutValue(-1), overrideCompress(false), overrideCompressValue(false) { @@ -48,6 +50,13 @@ IceInternal::DefaultsAndOverrides::DefaultsAndOverrides(const PropertiesPtr& pro const_cast<Int&>(overrideTimeoutValue) = properties->getPropertyAsInt("Ice.Override.Timeout"); } + value = properties->getProperty("Ice.Override.ConnectTimeout"); + if(!value.empty()) + { + const_cast<bool&>(overrideConnectTimeout) = true; + const_cast<Int&>(overrideConnectTimeoutValue) = properties->getPropertyAsInt("Ice.Override.ConnectTimeout"); + } + value = properties->getProperty("Ice.Override.Compress"); if(!value.empty()) { diff --git a/cpp/src/Ice/DefaultsAndOverrides.h b/cpp/src/Ice/DefaultsAndOverrides.h index 37bb99023e3..3ee7146d27d 100644 --- a/cpp/src/Ice/DefaultsAndOverrides.h +++ b/cpp/src/Ice/DefaultsAndOverrides.h @@ -35,6 +35,8 @@ public: bool overrideTimeout; Ice::Int overrideTimeoutValue; + bool overrideConnectTimeout; + Ice::Int overrideConnectTimeoutValue; bool overrideCompress; bool overrideCompressValue; }; diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp index b00df4b708e..222e889059f 100644 --- a/cpp/src/Ice/PropertiesI.cpp +++ b/cpp/src/Ice/PropertiesI.cpp @@ -119,6 +119,7 @@ static const string iceProps[] = "Nohup", "NullHandleAbort", "Override.Compress", + "Override.ConnectTimeout", "Override.Timeout", "Plugin.*", "PrintAdapterReady", |