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 | |
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
-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 | ||||
-rw-r--r-- | java/CHANGES | 3 | ||||
-rw-r--r-- | java/src/Ice/PropertiesI.java | 1 | ||||
-rw-r--r-- | java/src/IceInternal/DefaultsAndOverrides.java | 14 | ||||
-rw-r--r-- | java/src/IceInternal/OutgoingConnectionFactory.java | 17 |
10 files changed, 82 insertions, 2 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", diff --git a/java/CHANGES b/java/CHANGES index 56d0c77e301..8b998e7932b 100644 --- a/java/CHANGES +++ b/java/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/java/src/Ice/PropertiesI.java b/java/src/Ice/PropertiesI.java index 4d90af57074..9b992b58495 100644 --- a/java/src/Ice/PropertiesI.java +++ b/java/src/Ice/PropertiesI.java @@ -400,6 +400,7 @@ final class PropertiesI extends LocalObjectImpl implements Properties "Nohup", "NullHandleAbort", "Override.Compress", + "Override.ConnectTimeout", "Override.Timeout", "Plugin.*", "PrintAdapterReady", diff --git a/java/src/IceInternal/DefaultsAndOverrides.java b/java/src/IceInternal/DefaultsAndOverrides.java index c22c2baa7c5..92d50374543 100644 --- a/java/src/IceInternal/DefaultsAndOverrides.java +++ b/java/src/IceInternal/DefaultsAndOverrides.java @@ -46,6 +46,18 @@ public final class DefaultsAndOverrides overrideTimeoutValue = -1; } + value = properties.getProperty("Ice.Override.ConnectTimeout"); + if(value.length() > 0) + { + overrideConnectTimeout = true; + overrideConnectTimeoutValue = properties.getPropertyAsInt("Ice.Override.ConnectTimeout"); + } + else + { + overrideConnectTimeout = false; + overrideConnectTimeoutValue = -1; + } + value = properties.getProperty("Ice.Override.Compress"); if(value.length() > 0) { @@ -68,6 +80,8 @@ public final class DefaultsAndOverrides final public boolean overrideTimeout; final public int overrideTimeoutValue; + final public boolean overrideConnectTimeout; + final public int overrideConnectTimeoutValue; final public boolean overrideCompress; final public boolean overrideCompressValue; } diff --git a/java/src/IceInternal/OutgoingConnectionFactory.java b/java/src/IceInternal/OutgoingConnectionFactory.java index 2755c7cc417..8ed9c8fb6a4 100644 --- a/java/src/IceInternal/OutgoingConnectionFactory.java +++ b/java/src/IceInternal/OutgoingConnectionFactory.java @@ -259,7 +259,22 @@ public class OutgoingConnectionFactory { Connector connector = endpoint.connector(); assert(connector != null); - transceiver = connector.connect(endpoint.timeout()); + + int timeout; + DefaultsAndOverrides 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 != null); } connection = new Connection(_instance, transceiver, endpoint, null); |