summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Instance.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-12-21 15:25:37 -0500
committerBernard Normier <bernard@zeroc.com>2007-12-21 15:25:37 -0500
commite099cd4fd77c718f9c241ad609f5aa7a80627ba8 (patch)
tree998305e426f74429b00122dcdc4f839e2f97ade5 /cpp/src/Ice/Instance.cpp
parentIceUtil cleanup (first commit) (diff)
parentFix bug 2520: Test suite unsets ICE_CONFIG to avoid configuration conflicts (diff)
downloadice-e099cd4fd77c718f9c241ad609f5aa7a80627ba8.tar.bz2
ice-e099cd4fd77c718f9c241ad609f5aa7a80627ba8.tar.xz
ice-e099cd4fd77c718f9c241ad609f5aa7a80627ba8.zip
Merge branch 'master' of ssh://cvs.zeroc.com/home/git/ice
Conflicts: cpp/src/Slice/VbUtil.cpp
Diffstat (limited to 'cpp/src/Ice/Instance.cpp')
-rw-r--r--cpp/src/Ice/Instance.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index 38984229732..5fedbabce4c 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -199,6 +199,19 @@ IceInternal::Instance::objectAdapterFactory() const
return _objectAdapterFactory;
}
+ProtocolSupport
+IceInternal::Instance::protocolSupport() const
+{
+ IceUtil::RecMutex::Lock sync(*this);
+
+ if(_state == StateDestroyed)
+ {
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ }
+
+ return _protocolSupport;
+}
+
ThreadPoolPtr
IceInternal::Instance::clientThreadPool()
{
@@ -623,7 +636,8 @@ IceInternal::Instance::getAdmin()
}
catch(const ServerNotFoundException&)
{
- throw InitializationException(__FILE__, __LINE__, "Locator knows nothing about server '" + serverId + "'");
+ throw InitializationException(__FILE__, __LINE__, "Locator knows nothing about server '" +
+ serverId + "'");
}
}
@@ -890,6 +904,24 @@ 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;
+ if(!ipv4 && !ipv6)
+ {
+ throw InitializationException(__FILE__, __LINE__, "Both IPV4 and IPv6 support cannot be disabled.");
+ }
+ else if(ipv4 && ipv6)
+ {
+ _protocolSupport = EnableBoth;
+ }
+ else if(ipv4)
+ {
+ _protocolSupport = EnableIPv4;
+ }
+ else
+ {
+ _protocolSupport = EnableIPv6;
+ }
_endpointFactoryManager = new EndpointFactoryManager(this);
EndpointFactoryPtr tcpEndpointFactory = new TcpEndpointFactory(this);
_endpointFactoryManager->add(tcpEndpointFactory);