diff options
author | Marc Laukien <marc@zeroc.com> | 2001-12-06 20:50:34 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2001-12-06 20:50:34 +0000 |
commit | 69ab9df0b58233ca893407b0ef9fae5376413c06 (patch) | |
tree | 6806c4360e50f519a6cf085e78ad81c503bba932 /cpp/src/Ice/Instance.cpp | |
parent | default protocol (diff) | |
download | ice-69ab9df0b58233ca893407b0ef9fae5376413c06.tar.bz2 ice-69ab9df0b58233ca893407b0ef9fae5376413c06.tar.xz ice-69ab9df0b58233ca893407b0ef9fae5376413c06.zip |
Ice.DefaultHost, Ice.DefaultProtocol
Diffstat (limited to 'cpp/src/Ice/Instance.cpp')
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index 4740a822b3c..f0b2b1a9773 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -19,6 +19,7 @@ #include <Ice/Exception.h> #include <Ice/Properties.h> #include <Ice/LoggerI.h> +#include <Ice/Network.h> #ifndef WIN32 # include <Ice/SysLoggerI.h> @@ -149,6 +150,14 @@ IceInternal::Instance::defaultProtocol() return _defaultProtocol; } +string +IceInternal::Instance::defaultHost() +{ + // No synchronization necessary + // JTCSyncT<JTCMutex> sync(*this); + return _defaultHost; +} + IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const PropertiesPtr& properties) : _communicator(communicator), _properties(properties) @@ -269,6 +278,11 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Prope { _defaultProtocol = "tcp"; } + _defaultHost = _properties->getProperty("Ice.DefaultHost"); + if (_defaultHost.empty()) + { + _defaultHost = getLocalHost(true); + } } catch(...) { |