summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Instance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/Instance.cpp')
-rw-r--r--cpp/src/Ice/Instance.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index 9b17a5ecf43..d39bc669542 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -300,16 +300,15 @@ IceInternal::Instance::objectAdapterFactory() const
ProtocolSupport
IceInternal::Instance::protocolSupport() const
{
- IceUtil::RecMutex::Lock sync(*this);
-
- if(_state == StateDestroyed)
- {
- throw CommunicatorDestroyedException(__FILE__, __LINE__);
- }
-
return _protocolSupport;
}
+bool
+IceInternal::Instance::preferIPv6() const
+{
+ return _preferIPv6;
+}
+
ThreadPoolPtr
IceInternal::Instance::clientThreadPool()
{
@@ -1047,7 +1046,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
_proxyFactory = new ProxyFactory(this);
bool ipv4 = _initData.properties->getPropertyAsIntWithDefault("Ice.IPv4", 1) > 0;
- bool ipv6 = _initData.properties->getPropertyAsIntWithDefault("Ice.IPv6", 0) > 0;
+ bool ipv6 = _initData.properties->getPropertyAsIntWithDefault("Ice.IPv6", 1) > 0;
if(!ipv4 && !ipv6)
{
throw InitializationException(__FILE__, __LINE__, "Both IPV4 and IPv6 support cannot be disabled.");
@@ -1064,6 +1063,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
{
_protocolSupport = EnableIPv6;
}
+ _preferIPv6 = _initData.properties->getPropertyAsInt("Ice.PreferIPv6Address") > 0;
_endpointFactoryManager = new EndpointFactoryManager(this);
#ifndef ICE_OS_WINRT
EndpointFactoryPtr tcpEndpointFactory = new TcpEndpointFactory(this);