summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Instance.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2013-02-11 16:07:16 +0100
committerBenoit Foucher <benoit@zeroc.com>2013-02-11 16:07:16 +0100
commit0a52973ce569827357cfa9ac0a2e96c09ffbf7cc (patch)
treef219b25bebeca4f1e9e58e7174fe7870675b6246 /cpp/src/Ice/Instance.cpp
parentAdd Makefile.mak rule to register assemblies in source dir. (diff)
downloadice-0a52973ce569827357cfa9ac0a2e96c09ffbf7cc.tar.bz2
ice-0a52973ce569827357cfa9ac0a2e96c09ffbf7cc.tar.xz
ice-0a52973ce569827357cfa9ac0a2e96c09ffbf7cc.zip
Fixed ICE-5215: IPv6 support enabled by default
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);