summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Instance.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-09-10 08:47:19 +0200
committerBenoit Foucher <benoit@zeroc.com>2014-09-10 08:47:19 +0200
commitb6c9d9a880f6f1a6908a3c62dfccdce3e68dad80 (patch)
treed3e9e9340064538a8dc7a645260d0eb3cdf55d63 /cpp/src/Ice/Instance.cpp
parentUndo bogus change from an earlier commit. (diff)
downloadice-b6c9d9a880f6f1a6908a3c62dfccdce3e68dad80.tar.bz2
ice-b6c9d9a880f6f1a6908a3c62dfccdce3e68dad80.tar.xz
ice-b6c9d9a880f6f1a6908a3c62dfccdce3e68dad80.zip
ICE-5582 (SOCKs test), ICE-5314 (HTTP proxies), major refactoring of networking code (addition of StreamSocket class abstraction)
Diffstat (limited to 'cpp/src/Ice/Instance.cpp')
-rw-r--r--cpp/src/Ice/Instance.cpp23
1 files changed, 3 insertions, 20 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index 2bf9555f237..01c9d6d6b06 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -27,6 +27,7 @@
#include <Ice/PropertiesAdminI.h>
#include <Ice/LoggerI.h>
#include <Ice/Network.h>
+#include <Ice/NetworkProxy.h>
#include <Ice/EndpointFactoryManager.h>
#include <Ice/RetryQueue.h>
#include <Ice/DynamicLibrary.h>
@@ -1203,21 +1204,8 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
_proxyFactory = new ProxyFactory(this);
- string proxyHost = _initData.properties->getProperty("Ice.SOCKSProxyHost");
- int defaultIPv6 = 1; // IPv6 enabled by default.
- if(!proxyHost.empty())
- {
-#ifdef ICE_OS_WINRT
- throw InitializationException(__FILE__, __LINE__, "SOCKS proxy not supported in WinRT");
-#else
- int proxyPort = _initData.properties->getPropertyAsIntWithDefault("Ice.SOCKSProxyPort", 1080);
- _networkProxy = new SOCKSNetworkProxy(proxyHost, proxyPort);
- defaultIPv6 = 0; // IPv6 is not supported with SOCKS
-#endif
- }
-
bool ipv4 = _initData.properties->getPropertyAsIntWithDefault("Ice.IPv4", 1) > 0;
- bool ipv6 = _initData.properties->getPropertyAsIntWithDefault("Ice.IPv6", defaultIPv6) > 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.");
@@ -1236,12 +1224,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
}
_preferIPv6 = _initData.properties->getPropertyAsInt("Ice.PreferIPv6Address") > 0;
-#ifndef ICE_OS_WINRT
- if(ipv6 && SOCKSNetworkProxyPtr::dynamicCast(_networkProxy))
- {
- throw InitializationException(__FILE__, __LINE__, "IPv6 is not supported with SOCKS4 proxies");
- }
-#endif
+ _networkProxy = IceInternal::createNetworkProxy(_initData.properties, _protocolSupport);
_endpointFactoryManager = new EndpointFactoryManager(this);
#ifndef ICE_OS_WINRT