diff options
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(...) { |