diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/Ice/CommunicatorI.cpp | 8 | ||||
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 12 | ||||
-rw-r--r-- | cpp/src/Ice/LoggerI.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/LoggerI.h | 2 | ||||
-rw-r--r-- | cpp/src/Ice/Network.cpp | 7 | ||||
-rw-r--r-- | cpp/src/Ice/Network.h | 3 | ||||
-rw-r--r-- | cpp/src/Ice/winrt/Makefile.mak | 27 | ||||
-rw-r--r-- | cpp/src/Ice/winrt/StreamTransceiver.h | 1 | ||||
-rw-r--r-- | cpp/src/IceWS/AcceptorI.cpp | 10 | ||||
-rw-r--r-- | cpp/src/IceWS/AcceptorI.h | 6 | ||||
-rw-r--r-- | cpp/src/IceWS/EndpointI.h | 4 | ||||
-rw-r--r-- | cpp/src/IceWS/TransceiverI.cpp | 55 | ||||
-rw-r--r-- | cpp/src/IceWS/TransceiverI.h | 6 | ||||
-rw-r--r-- | cpp/src/IceWS/Util.cpp | 19 | ||||
-rw-r--r-- | cpp/src/IceWS/winrt/.depend.mak | 5 | ||||
-rw-r--r-- | cpp/src/IceWS/winrt/Makefile.mak | 70 | ||||
-rw-r--r-- | cpp/src/Makefile.mak | 1 | ||||
-rw-r--r-- | cpp/test/Ice/info/Makefile.mak | 2 | ||||
-rw-r--r-- | cpp/test/Ice/proxy/AllTests.cpp | 20 | ||||
-rw-r--r-- | cpp/test/WinRT/TestSuite/MainPage.xaml | 8 | ||||
-rw-r--r-- | cpp/test/WinRT/TestSuite/MainPage.xaml.cpp | 128 |
21 files changed, 246 insertions, 150 deletions
diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp index 25fc6841fb3..fbac019a293 100644 --- a/cpp/src/Ice/CommunicatorI.cpp +++ b/cpp/src/Ice/CommunicatorI.cpp @@ -26,6 +26,10 @@ #include <IceUtil/MutexPtrLock.h> #include <IceUtil/UUID.h> +#ifdef ICE_OS_WINRT +# include <IceWS/PluginI.h> +#endif + using namespace std; using namespace Ice; using namespace IceInternal; @@ -458,6 +462,10 @@ Ice::CommunicatorI::~CommunicatorI() void Ice::CommunicatorI::finishSetup(int& argc, char* argv[]) { +#if defined(ICE_OS_WINRT) + Ice::PluginPtr plugin(new IceWS::PluginI(this)); // Initialize the IceWS transport. +#endif + try { _instance->finishSetup(argc, argv); diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index 39668b5340e..20744535880 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -1105,13 +1105,13 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi EndpointFactoryPtr tcpEndpointFactory = new TcpEndpointFactory(tcpProtocolInstance); _endpointFactoryManager->add(tcpEndpointFactory); #else - ProtocolInstancePtr tcpProtocolInstance = new ProtocolInstance(this, TCPEndpointType, "tcp"); - EndpointFactoryPtr tcpStreamEndpointFactory = new StreamEndpointFactory(tcpProtocolInstance); - _endpointFactoryManager->add(tcpStreamEndpointFactory); + ProtocolInstancePtr tcpInstance = new ProtocolInstance(this, TCPEndpointType, "tcp"); + EndpointFactoryPtr tcpFactory = new StreamEndpointFactory(tcpInstance); + _endpointFactoryManager->add(tcpFactory); - ProtocolInstancePtr sslProtocolInstance = new ProtocolInstance(this, IceSSL::EndpointType, "ssl"); - EndpointFactoryPtr sslStreamEndpointFactory = new StreamEndpointFactory(sslProtocolInstance); - _endpointFactoryManager->add(sslStreamEndpointFactory); + ProtocolInstancePtr sslInstance = new ProtocolInstance(this, IceSSL::EndpointType, "ssl"); + EndpointFactoryPtr sslFactory = new StreamEndpointFactory(sslInstance); + _endpointFactoryManager->add(sslFactory); #endif ProtocolInstancePtr udpProtocolInstance = new ProtocolInstance(this, UDPEndpointType, "udp"); EndpointFactoryPtr udpEndpointFactory = new UdpEndpointFactory(udpProtocolInstance); diff --git a/cpp/src/Ice/LoggerI.cpp b/cpp/src/Ice/LoggerI.cpp index bfd602d0a5f..f0215401657 100644 --- a/cpp/src/Ice/LoggerI.cpp +++ b/cpp/src/Ice/LoggerI.cpp @@ -52,7 +52,7 @@ Ice::LoggerI::LoggerI(const string& prefix, const string& file, bool convert, const IceUtil::StringConverterPtr& converter) : _convert(convert), _converter(converter) -#ifdef _WIN32 +#if defined(_WIN32) && !defined(ICE_OS_WINRT) , _consoleConverter(new IceUtil::WindowsStringConverter(GetConsoleOutputCP())) #endif diff --git a/cpp/src/Ice/LoggerI.h b/cpp/src/Ice/LoggerI.h index 4e26f338a84..1ae72c9445b 100644 --- a/cpp/src/Ice/LoggerI.h +++ b/cpp/src/Ice/LoggerI.h @@ -42,7 +42,7 @@ private: std::string _file; -#ifdef _WIN32 +#if defined(_WIN32) && !defined(ICE_OS_WINRT) const IceUtil::StringConverterPtr _consoleConverter; #endif diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp index 564c9c20b62..4108dd23053 100644 --- a/cpp/src/Ice/Network.cpp +++ b/cpp/src/Ice/Network.cpp @@ -722,6 +722,13 @@ IceInternal::NativeInfo::completed(SocketOperation operation) throw ex; } } +#elif defined(ICE_OS_WINRT) +void +IceInternal::NativeInfo::completed(SocketOperation operation) +{ + assert(_completedHandler); + _completedHandler(operation); +} #endif IceUtil::Shared* IceInternal::upCast(NetworkProxy* p) { return p; } diff --git a/cpp/src/Ice/Network.h b/cpp/src/Ice/Network.h index 7576f48ca30..f8928c11f7b 100644 --- a/cpp/src/Ice/Network.h +++ b/cpp/src/Ice/Network.h @@ -182,6 +182,7 @@ public: void completed(SocketOperation operation); #elif defined(ICE_OS_WINRT) virtual void setCompletedHandler(SocketOperationCompletedHandler^) = 0; + void completed(SocketOperation operation); #endif protected: @@ -191,6 +192,8 @@ protected: #if defined(ICE_USE_IOCP) HANDLE _handle; ULONG_PTR _key; +#elif defined(ICE_OS_WINRT) + SocketOperationCompletedHandler^ _completedHandler; #endif }; typedef IceUtil::Handle<NativeInfo> NativeInfoPtr; diff --git a/cpp/src/Ice/winrt/Makefile.mak b/cpp/src/Ice/winrt/Makefile.mak index a48b50a46d9..70766253b5f 100644 --- a/cpp/src/Ice/winrt/Makefile.mak +++ b/cpp/src/Ice/winrt/Makefile.mak @@ -117,6 +117,16 @@ LOCAL_OBJS = $(ARCH)\$(CONFIG)\StreamAcceptor.obj \ $(ARCH)\$(CONFIG)\EndpointInfo.obj \ $(ARCH)\$(CONFIG)\ConnectionInfo.obj \ +WS_OBJS = $(ARCH)\$(CONFIG)\IceWS\AcceptorI.obj \ + $(ARCH)\$(CONFIG)\IceWS\ConnectorI.obj \ + $(ARCH)\$(CONFIG)\IceWS\ConnectionInfo.obj \ + $(ARCH)\$(CONFIG)\IceWS\EndpointInfo.obj \ + $(ARCH)\$(CONFIG)\IceWS\EndpointI.obj \ + $(ARCH)\$(CONFIG)\IceWS\PluginI.obj \ + $(ARCH)\$(CONFIG)\IceWS\Instance.obj \ + $(ARCH)\$(CONFIG)\IceWS\TransceiverI.obj \ + $(ARCH)\$(CONFIG)\IceWS\Util.obj + SLICE_CORE_SRCS = $(slicedir)\Ice\BuiltinSequences.ice \ $(slicedir)\Ice\CommunicatorF.ice \ $(slicedir)\Ice\Communicator.ice \ @@ -172,8 +182,16 @@ LOCAL_SRCS = $(LOCAL_SRCS:arm\=) LOCAL_SRCS = $(LOCAL_SRCS:Retail\=.\) LOCAL_SRCS = $(LOCAL_SRCS:Debug\=.\) +WS_SRCS = $(WS_OBJS:.obj=.cpp) +WS_SRCS = $(WS_SRCS:x86\=) +WS_SRCS = $(WS_SRCS:x64\=) +WS_SRCS = $(WS_SRCS:arm\=) +WS_SRCS = $(WS_SRCS:Retail\=..\..\) +WS_SRCS = $(WS_SRCS:Debug\=..\..\) + SRCS = $(SRCS) \ $(LOCAL_SRCS) \ + $(WS_SRCS) \ ..\CommunicatorF.cpp \ ..\ConnectionF.cpp \ ..\EndpointF.cpp \ @@ -198,8 +216,8 @@ SSL_SLICE2CPPFLAGS = --ice --include-dir IceSSL --dll-export ICE_SSL_API $(SLIC !include $(top_srcdir)\config\Make.rules.mak -$(LIBNAME): $(LOCAL_OBJS) $(OBJS) sdks - $(AR) $(ARFLAGS) $(OBJS) $(LOCAL_OBJS) /out:$(LIBNAME) +$(LIBNAME): $(LOCAL_OBJS) $(OBJS) $(WS_OBJS) sdks + $(AR) $(ARFLAGS) $(OBJS) $(LOCAL_OBJS) $(WS_OBJS) /out:$(LIBNAME) Service.obj: $(SOURCE_DIR)\EventLoggerMsg.h @@ -209,6 +227,10 @@ Ice.res: $(SOURCE_DIR)\EventLoggerMsg.rc @if not exist "$(ARCH)\$(CONFIG)" mkdir $(ARCH)\$(CONFIG) $(CXX) /c /Fo$(ARCH)\$(CONFIG)\ $(CPPFLAGS) $(CXXFLAGS) $< +{..\..\IceWS\}.cpp{$(ARCH)\$(CONFIG)\IceWS\}.obj:: + @if not exist "$(ARCH)\$(CONFIG)\IceWS" mkdir $(ARCH)\$(CONFIG)\IceWS + $(CXX) /c /Fo$(ARCH)\$(CONFIG)\IceWS\ $(CPPFLAGS) $(CXXFLAGS) $< + {$(slicedir)\Ice}.ice.cpp: @echo c del /q $(headerdir)\Ice\$(*F).h $(*F).cpp @@ -276,6 +298,7 @@ clean:: -del /q EndpointInfo.cpp $(headerdir)\IceSSL\EndpointInfo.h -del /q ConnectionInfo.cpp $(headerdir)\IceSSL\ConnectionInfo.h -del /q $(ARCH)\$(CONFIG)\*.obj + -del /q $(ARCH)\$(CONFIG)\IceWS\*.obj -del /q $(PDBNAME) install:: all diff --git a/cpp/src/Ice/winrt/StreamTransceiver.h b/cpp/src/Ice/winrt/StreamTransceiver.h index 46354c62352..160f7c0122e 100644 --- a/cpp/src/Ice/winrt/StreamTransceiver.h +++ b/cpp/src/Ice/winrt/StreamTransceiver.h @@ -76,7 +76,6 @@ private: Windows::Storage::Streams::DataReader^ _reader; Windows::Storage::Streams::DataWriter^ _writer; - SocketOperationCompletedHandler^ _completedHandler; Windows::Foundation::AsyncOperationCompletedHandler<unsigned int>^ _readOperationCompletedHandler; Windows::Foundation::AsyncOperationCompletedHandler<unsigned int>^ _writeOperationCompletedHandler; }; diff --git a/cpp/src/IceWS/AcceptorI.cpp b/cpp/src/IceWS/AcceptorI.cpp index c3f536c733b..eadeb3b2ebd 100644 --- a/cpp/src/IceWS/AcceptorI.cpp +++ b/cpp/src/IceWS/AcceptorI.cpp @@ -21,12 +21,18 @@ IceWS::AcceptorI::getNativeInfo() return _delegate->getNativeInfo(); } -#ifdef ICE_USE_IOCP +#if defined(ICE_USE_IOCP) IceInternal::AsyncInfo* IceWS::AcceptorI::getAsyncInfo(IceInternal::SocketOperation status) { return _delegate->getNativeInfo()->getAsyncInfo(status); } +#elif defined(ICE_OS_WINRT) +void +IceWS::AcceptorI::setCompletedHandler(IceInternal::SocketOperationCompletedHandler^ handler) +{ + _delegate->getNativeInfo()->setCompletedHandler(handler); +} #endif void @@ -41,7 +47,7 @@ IceWS::AcceptorI::listen() _delegate->listen(); } -#ifdef ICE_USE_IOCP +#if defined(ICE_USE_IOCP) || defined(ICE_OS_WINRT) void IceWS::AcceptorI::startAccept() { diff --git a/cpp/src/IceWS/AcceptorI.h b/cpp/src/IceWS/AcceptorI.h index 90a156c33ce..110532f89e2 100644 --- a/cpp/src/IceWS/AcceptorI.h +++ b/cpp/src/IceWS/AcceptorI.h @@ -26,13 +26,15 @@ class AcceptorI : public IceInternal::Acceptor, public IceInternal::NativeInfo public: virtual IceInternal::NativeInfoPtr getNativeInfo(); -#ifdef ICE_USE_IOCP +#if defined(ICE_USE_IOCP) virtual IceInternal::AsyncInfo* getAsyncInfo(IceInternal::SocketOperation); +#elif defined(ICE_OS_WINRT) + virtual void setCompletedHandler(IceInternal::SocketOperationCompletedHandler^); #endif virtual void close(); virtual void listen(); -#ifdef ICE_USE_IOCP +#if defined(ICE_USE_IOCP) || defined(ICE_OS_WINRT) virtual void startAccept(); virtual void finishAccept(); #endif diff --git a/cpp/src/IceWS/EndpointI.h b/cpp/src/IceWS/EndpointI.h index 119a937b051..35ed4883e3c 100644 --- a/cpp/src/IceWS/EndpointI.h +++ b/cpp/src/IceWS/EndpointI.h @@ -71,6 +71,7 @@ class EndpointFactoryI : public IceInternal::EndpointFactory { public: + EndpointFactoryI(const InstancePtr&, const IceInternal::EndpointFactoryPtr&); virtual ~EndpointFactoryI(); virtual Ice::Short type() const; @@ -83,9 +84,6 @@ public: private: - EndpointFactoryI(const InstancePtr&, const IceInternal::EndpointFactoryPtr&); - friend class PluginI; - InstancePtr _instance; const IceInternal::EndpointFactoryPtr _delegate; }; diff --git a/cpp/src/IceWS/TransceiverI.cpp b/cpp/src/IceWS/TransceiverI.cpp index ad3bb210d59..597e432b19b 100644 --- a/cpp/src/IceWS/TransceiverI.cpp +++ b/cpp/src/IceWS/TransceiverI.cpp @@ -19,7 +19,7 @@ #include <Ice/Base64.h> #include <IceUtil/Random.h> #include <IceUtil/StringUtil.h> - + #include <IceUtil/DisableWarnings.h> #include <stdint.h> @@ -123,6 +123,47 @@ Long nlltoh(const Byte* src) return v; } +Short htons(Short v) +{ + Short result; + Byte* dest = reinterpret_cast<Byte*>(&result); + + // + // Transfer a short in network (big-endian) order. + // +#ifdef ICE_BIG_ENDIAN + const Byte* src = reinterpret_cast<const Byte*>(&v); + *dest++ = *src++; + *dest = *src; +#else + const Byte* src = reinterpret_cast<const Byte*>(&v) + sizeof(Short) - 1; + *dest++ = *src--; + *dest = *src; +#endif + return result; +} + +Short ntohs(Short value) +{ + const Byte* src = reinterpret_cast<Byte*>(&value); + Short v; + + // + // Extract a 64-bit integer in network (big-endian) order. + // +#ifdef ICE_BIG_ENDIAN + Byte* dest = reinterpret_cast<Byte*>(&v); + *dest++ = *src++; + *dest = *src; +#else + Byte* dest = reinterpret_cast<Byte*>(&v) + sizeof(Short) - 1; + *dest-- = *src++; + *dest = *src; +#endif + + return v; +} + } NativeInfoPtr @@ -131,12 +172,18 @@ IceWS::TransceiverI::getNativeInfo() return _delegate->getNativeInfo(); } -#ifdef ICE_USE_IOCP +#if defined(ICE_USE_IOCP) AsyncInfo* IceWS::TransceiverI::getAsyncInfo(SocketOperation status) { return _delegate->getNativeInfo()->getAsyncInfo(status); } +#elif defined(ICE_OS_WINRT) +void +IceWS::TransceiverI::setCompletedHandler(IceInternal::SocketOperationCompletedHandler^ handler) +{ + _delegate->getNativeInfo()->setCompletedHandler(handler); +} #endif SocketOperation @@ -539,7 +586,7 @@ IceWS::TransceiverI::read(Buffer& buf, bool& hasMoreData) return s; } -#ifdef ICE_USE_IOCP +#if defined(ICE_USE_IOCP) || defined(ICE_OS_WINRT) bool IceWS::TransceiverI::startWrite(Buffer& buf) { @@ -552,7 +599,7 @@ IceWS::TransceiverI::startWrite(Buffer& buf) } else { - return _delegate->startWrite(buf); + return _delegate->startWrite(_writeBuffer); } } diff --git a/cpp/src/IceWS/TransceiverI.h b/cpp/src/IceWS/TransceiverI.h index c07ff0acd43..cba5439b8b5 100644 --- a/cpp/src/IceWS/TransceiverI.h +++ b/cpp/src/IceWS/TransceiverI.h @@ -30,8 +30,10 @@ class TransceiverI : public IceInternal::Transceiver public: virtual IceInternal::NativeInfoPtr getNativeInfo(); -#ifdef ICE_USE_IOCP +#if defined(ICE_USE_IOCP) virtual IceInternal::AsyncInfo* getAsyncInfo(IceInternal::SocketOperation); +#elif defined(ICE_OS_WINRT) + virtual void setCompletedHandler(IceInternal::SocketOperationCompletedHandler^); #endif virtual IceInternal::SocketOperation initialize(IceInternal::Buffer&, IceInternal::Buffer&, bool&); @@ -39,7 +41,7 @@ public: virtual void close(); virtual IceInternal::SocketOperation write(IceInternal::Buffer&); virtual IceInternal::SocketOperation read(IceInternal::Buffer&, bool&); -#ifdef ICE_USE_IOCP +#if defined(ICE_USE_IOCP) || defined(ICE_OS_WINRT) virtual bool startWrite(IceInternal::Buffer&); virtual void finishWrite(IceInternal::Buffer&); virtual void startRead(IceInternal::Buffer&); diff --git a/cpp/src/IceWS/Util.cpp b/cpp/src/IceWS/Util.cpp index 417acc68cb2..b4ee81fc485 100644 --- a/cpp/src/IceWS/Util.cpp +++ b/cpp/src/IceWS/Util.cpp @@ -12,8 +12,10 @@ #include <Ice/LocalException.h> #include <IceUtil/StringUtil.h> -#include <openssl/err.h> -#include <openssl/sha.h> +#ifndef ICE_OS_WINRT +# include <openssl/err.h> +# include <openssl/sha.h> +#endif #include <IceUtil/DisableWarnings.h> @@ -24,9 +26,22 @@ using namespace IceWS; vector<unsigned char> IceWS::calcSHA1(const vector<unsigned char>& data) { +#ifndef ICE_OS_WINRT vector<unsigned char> hash(SHA_DIGEST_LENGTH); ::SHA1(&data[0], static_cast<unsigned long>(data.size()), &hash[0]); return hash; +#else + auto dataA = ref new Platform::Array<unsigned char>(const_cast<unsigned char*>(&data[0]), data.size()); + auto hasher = Windows::Security::Cryptography::Core::HashAlgorithmProvider::OpenAlgorithm("SHA1"); + auto hashed = hasher->HashData(Windows::Security::Cryptography::CryptographicBuffer::CreateFromByteArray(dataA)); + auto reader = ::Windows::Storage::Streams::DataReader::FromBuffer(hashed); + std::vector<unsigned char> result(reader->UnconsumedBufferLength); + if(!result.empty()) + { + reader->ReadBytes(::Platform::ArrayReference<unsigned char>(&result[0], result.size())); + } + return result; +#endif } WebSocketException::WebSocketException(const string& r) : diff --git a/cpp/src/IceWS/winrt/.depend.mak b/cpp/src/IceWS/winrt/.depend.mak deleted file mode 100644 index 3d037292037..00000000000 --- a/cpp/src/IceWS/winrt/.depend.mak +++ /dev/null @@ -1,5 +0,0 @@ -$(ARCH)\$(CONFIG)\EndpointInfo$(OBJEXT): ..\EndpointInfo.cpp "$(includedir)\Ice\ProxyF.h" "$(includedir)\IceUtil\Shared.h" "$(includedir)\IceUtil\Config.h" "$(includedir)\Ice\Config.h" "$(includedir)\Ice\ProxyHandle.h" "$(includedir)\IceUtil\Handle.h" "$(includedir)\IceUtil\Exception.h" "$(includedir)\Ice\ObjectF.h" "$(includedir)\Ice\Handle.h" "$(includedir)\Ice\Exception.h" "$(includedir)\Ice\Format.h" "$(includedir)\Ice\StreamF.h" "$(includedir)\Ice\LocalObject.h" "$(includedir)\Ice\LocalObjectF.h" "$(includedir)\Ice\StreamHelpers.h" "$(includedir)\IceUtil\ScopedArray.h" "$(includedir)\IceUtil\Iterator.h" "$(includedir)\IceUtil\Optional.h" "$(includedir)\Ice\Endpoint.h" "$(includedir)\Ice\Version.h" "$(includedir)\IceUtil\UndefSysMacros.h" "$(includedir)\Ice\BuiltinSequences.h" "$(includedir)\Ice\EndpointF.h" "$(includedir)\Ice\BasicStream.h" "$(includedir)\IceUtil\StringConverter.h" "$(includedir)\IceUtil\Unicode.h" "$(includedir)\Ice\InstanceF.h" "$(includedir)\Ice\Object.h" "$(includedir)\IceUtil\Mutex.h" "$(includedir)\IceUtil\Lock.h" "$(includedir)\IceUtil\ThreadException.h" "$(includedir)\IceUtil\Time.h" "$(includedir)\IceUtil\MutexProtocol.h" "$(includedir)\Ice\GCShared.h" "$(includedir)\Ice\GCCountMap.h" "$(includedir)\Ice\IncomingAsyncF.h" "$(includedir)\Ice\Current.h" "$(includedir)\Ice\ObjectAdapterF.h" "$(includedir)\Ice\ConnectionF.h" "$(includedir)\Ice\Identity.h" "$(includedir)\Ice\ObjectFactoryF.h" "$(includedir)\Ice\ObjectFactoryManagerF.h" "$(includedir)\Ice\Buffer.h" "$(includedir)\Ice\Protocol.h" "$(includedir)\Ice\SlicedDataF.h" "$(includedir)\Ice\UserExceptionFactory.h" "$(includedir)\Ice\FactoryTable.h" "$(includedir)\IceUtil\DisableWarnings.h" -$(ARCH)\$(CONFIG)\ConnectionInfo$(OBJEXT): ..\ConnectionInfo.cpp "$(includedir)\Ice\ProxyF.h" "$(includedir)\IceUtil\Shared.h" "$(includedir)\IceUtil\Config.h" "$(includedir)\Ice\Config.h" "$(includedir)\Ice\ProxyHandle.h" "$(includedir)\IceUtil\Handle.h" "$(includedir)\IceUtil\Exception.h" "$(includedir)\Ice\ObjectF.h" "$(includedir)\Ice\Handle.h" "$(includedir)\Ice\Exception.h" "$(includedir)\Ice\Format.h" "$(includedir)\Ice\StreamF.h" "$(includedir)\Ice\LocalObject.h" "$(includedir)\Ice\LocalObjectF.h" "$(includedir)\Ice\StreamHelpers.h" "$(includedir)\IceUtil\ScopedArray.h" "$(includedir)\IceUtil\Iterator.h" "$(includedir)\Ice\Proxy.h" "$(includedir)\IceUtil\Mutex.h" "$(includedir)\IceUtil\Lock.h" "$(includedir)\IceUtil\ThreadException.h" "$(includedir)\IceUtil\Time.h" "$(includedir)\IceUtil\MutexProtocol.h" "$(includedir)\Ice\ProxyFactoryF.h" "$(includedir)\Ice\ConnectionIF.h" "$(includedir)\Ice\RequestHandlerF.h" "$(includedir)\Ice\EndpointF.h" "$(includedir)\IceUtil\Optional.h" "$(includedir)\IceUtil\UndefSysMacros.h" "$(includedir)\Ice\EndpointTypes.h" "$(includedir)\Ice\ObjectAdapterF.h" "$(includedir)\Ice\ReferenceF.h" "$(includedir)\Ice\OutgoingAsync.h" "$(includedir)\IceUtil\Monitor.h" "$(includedir)\IceUtil\Cond.h" "$(includedir)\IceUtil\Timer.h" "$(includedir)\IceUtil\Thread.h" "$(includedir)\IceUtil\UniquePtr.h" "$(includedir)\Ice\OutgoingAsyncF.h" "$(includedir)\Ice\InstanceF.h" "$(includedir)\Ice\CommunicatorF.h" "$(includedir)\Ice\Current.h" "$(includedir)\Ice\ConnectionF.h" "$(includedir)\Ice\Identity.h" "$(includedir)\Ice\Version.h" "$(includedir)\Ice\BasicStream.h" "$(includedir)\IceUtil\StringConverter.h" "$(includedir)\IceUtil\Unicode.h" "$(includedir)\Ice\Object.h" "$(includedir)\Ice\GCShared.h" "$(includedir)\Ice\GCCountMap.h" "$(includedir)\Ice\IncomingAsyncF.h" "$(includedir)\Ice\ObjectFactoryF.h" "$(includedir)\Ice\ObjectFactoryManagerF.h" "$(includedir)\Ice\Buffer.h" "$(includedir)\Ice\Protocol.h" "$(includedir)\Ice\SlicedDataF.h" "$(includedir)\Ice\UserExceptionFactory.h" "$(includedir)\Ice\FactoryTable.h" "$(includedir)\Ice\ObserverHelper.h" "$(includedir)\Ice\Instrumentation.h" "$(includedir)\Ice\Connection.h" "$(includedir)\Ice\Endpoint.h" "$(includedir)\Ice\BuiltinSequences.h" "$(includedir)\IceUtil\DisableWarnings.h" -$(HDIR)\EndpointInfo.h ..\EndpointInfo.cpp: "$(slicedir)\IceWS\EndpointInfo.ice" "$(slicedir)\Ice\Endpoint.ice" "$(slicedir)\Ice\Version.ice" "$(slicedir)\Ice\BuiltinSequences.ice" "$(slicedir)\Ice\EndpointF.ice" "$(SLICE2CPP)" -$(HDIR)\ConnectionInfo.h ..\ConnectionInfo.cpp: "$(slicedir)\IceWS\ConnectionInfo.ice" "$(slicedir)\Ice\Connection.ice" "$(slicedir)\Ice\ObjectAdapterF.ice" "$(slicedir)\Ice\Identity.ice" "$(slicedir)\Ice\Endpoint.ice" "$(slicedir)\Ice\Version.ice" "$(slicedir)\Ice\BuiltinSequences.ice" "$(slicedir)\Ice\EndpointF.ice" "$(SLICE2CPP)" - diff --git a/cpp/src/IceWS/winrt/Makefile.mak b/cpp/src/IceWS/winrt/Makefile.mak deleted file mode 100644 index 44de6843cc4..00000000000 --- a/cpp/src/IceWS/winrt/Makefile.mak +++ /dev/null @@ -1,70 +0,0 @@ -# ********************************************************************** -# -# Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved. -# -# This copy of Ice is licensed to you under the terms described in the -# ICE_LICENSE file included in this distribution. -# -# ********************************************************************** - -top_srcdir = ..\..\.. -LIBNAME = $(SDK_LIBRARY_PATH)\icews.lib -TARGETS = $(LIBNAME) -SOURCE_DIR = .. - -TARGETS = $(LIBNAME) - -OBJS = $(ARCH)\$(CONFIG)\EndpointInfo.obj \ - $(ARCH)\$(CONFIG)\ConnectionInfo.obj - -# OBJS = $(ARCH)\$(CONFIG)\AcceptorI.obj \ -# $(ARCH)\$(CONFIG)\ConnectorI.obj \ -# $(ARCH)\$(CONFIG)\ConnectionInfo.obj \ -# $(ARCH)\$(CONFIG)\EndpointInfo.obj \ -# $(ARCH)\$(CONFIG)\EndpointI.obj \ -# $(ARCH)\$(CONFIG)\Instance.obj \ -# $(ARCH)\$(CONFIG)\PluginI.obj \ -# $(ARCH)\$(CONFIG)\TransceiverI.obj \ -# $(ARCH)\$(CONFIG)\Util.obj - -SLICE_SRCS = $(SDIR)/EndpointInfo.ice \ - $(SDIR)/ConnectionInfo.ice - -SRCS = $(OBJS:.obj=.cpp) -SRCS = $(SRCS:x86\=) -SRCS = $(SRCS:x64\=) -SRCS = $(SRCS:arm\=) -SRCS = $(SRCS:Retail\=..\) -SRCS = $(SRCS:Debug\=..\) - -HDIR = $(headerdir)\IceWS -SDIR = $(slicedir)\IceWS - -PDBNAME = $(LIBNAME:.lib=.pdb) -CPPFLAGS = /Fd$(PDBNAME) -I..\.. $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN -SLICE2CPPFLAGS = --checksum --ice --include-dir IceWS --dll-export ICE_WS_API - -!include $(top_srcdir)\config\Make.rules.mak - -$(LIBNAME): $(OBJS) sdks - $(AR) $(ARFLAGS) $(OBJS) /out:$(LIBNAME) - -depend:: - del /q .depend.mak - -.cpp.depend: - $(CXX) /Fo$(ARCH)\$(CONFIG)\ /Fd$(ARCH)\$(CONFIG)\ /Zs /showIncludes $(CXXFLAGS) $(CPPFLAGS) $< 2>&1 | python.exe $(ice_dir)/config/makedepend-winrt.py $< - -depend:: $(ARCH)\$(CONFIG) $(SLICE_SRCS) $(SRCS) $(SRCS_DEPEND) - @if not "$(SLICE_SRCS)" == "" \ - $(SLICE2CPP) --depend $(SLICE2CPPFLAGS) $(SLICE_SRCS) | python.exe $(ice_dir)\config\makedepend-winrt.py - -clean:: - -del /q $(SOURCE_DIR)\EndpointInfo.cpp $(HDIR)\EndpointInfo.h - -del /q $(SOURCE_DIR)\ConnectionInfo.cpp $(HDIR)\ConnectionInfo.h - -del /q $(ARCH)\$(CONFIG)\*.obj - -del /q $(PDBNAME) - -install:: all - -!include .depend.mak diff --git a/cpp/src/Makefile.mak b/cpp/src/Makefile.mak index fa3500376d3..b4f49ead099 100644 --- a/cpp/src/Makefile.mak +++ b/cpp/src/Makefile.mak @@ -14,7 +14,6 @@ top_srcdir = .. !if "$(WINRT)" == "yes" SUBDIRS = IceUtil\winrt \ Ice\winrt \ - IceWS\winrt \ Glacier2Lib\winrt \ IceStormLib\winrt \ IceGridLib\winrt diff --git a/cpp/test/Ice/info/Makefile.mak b/cpp/test/Ice/info/Makefile.mak index 8e36d7a3960..0d13118449e 100644 --- a/cpp/test/Ice/info/Makefile.mak +++ b/cpp/test/Ice/info/Makefile.mak @@ -42,7 +42,7 @@ CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN LD_TESTFLAGS = $(LD_EXEFLAGS) $(SETARGV) LIBS = $(LIBS) icessl$(LIBSUFFIX).lib icews$(LIBSUFFIX).lib !else -LD_TESTFLAGS = icews.lib $(LD_DLLFLAGS) /export:dllMain +LD_TESTFLAGS = $(LD_DLLFLAGS) /export:dllMain !endif !if "$(GENERATE_PDB)" == "yes" diff --git a/cpp/test/Ice/proxy/AllTests.cpp b/cpp/test/Ice/proxy/AllTests.cpp index ec458abf2f5..32cad69153d 100644 --- a/cpp/test/Ice/proxy/AllTests.cpp +++ b/cpp/test/Ice/proxy/AllTests.cpp @@ -916,18 +916,16 @@ allTests(const Ice::CommunicatorPtr& communicator) // NoEndpointException (or ConnectionRefusedException when // running with SSL). // - try - { - p1->ice_encodingVersion(Ice::Encoding_1_0)->ice_ping(); - test(false); - } - catch(const Ice::NoEndpointException&) - { - test(!ssl); - } - catch(const Ice::ConnectFailedException&) + if(ssl) { - test(!tcp); + try + { + p1->ice_encodingVersion(Ice::Encoding_1_0)->ice_ping(); + test(false); + } + catch(const Ice::ConnectFailedException&) + { + } } // diff --git a/cpp/test/WinRT/TestSuite/MainPage.xaml b/cpp/test/WinRT/TestSuite/MainPage.xaml index 7a44fa90497..e840787a753 100644 --- a/cpp/test/WinRT/TestSuite/MainPage.xaml +++ b/cpp/test/WinRT/TestSuite/MainPage.xaml @@ -63,7 +63,13 @@ <CheckBox x:Name="chkLoop" Content="Run In A Loop" Margin="10, 0, 0, 0"/> <CheckBox x:Name="chkSerialize" Content="Enable Serialize Mode" Margin="10, 0, 0, 0"/> <CheckBox x:Name="chkIPv6" Content="Use IPv6" Margin="10, 0, 0, 0"/> - <CheckBox x:Name="chkSSL" Content="Enable SSL" Margin="10, 0, 0, 0"/> + <TextBlock Text="Protocol" Margin="10, 0, 0, 0" VerticalAlignment="Center" Style="{StaticResource BasicTextStyle}" FontSize="16"/> + <ComboBox x:Name="protocol" SelectedIndex="0" Margin="10, 0, 0, 0"> + <ComboBoxItem Name="tcp">tcp</ComboBoxItem> + <ComboBoxItem Name="ssl">ssl</ComboBoxItem> + <ComboBoxItem Name="ws">ws</ComboBoxItem> + <ComboBoxItem Name="wss">wss</ComboBoxItem> + </ComboBox> </StackPanel> </Border> </Grid> diff --git a/cpp/test/WinRT/TestSuite/MainPage.xaml.cpp b/cpp/test/WinRT/TestSuite/MainPage.xaml.cpp index d6c1714b781..eb1daf78bce 100644 --- a/cpp/test/WinRT/TestSuite/MainPage.xaml.cpp +++ b/cpp/test/WinRT/TestSuite/MainPage.xaml.cpp @@ -71,11 +71,23 @@ enum TestConfigType { TestConfigTypeClient, TestConfigTypeServer, TestConfigType struct TestConfig { TestConfigType type; - bool ssl; + string protocol; bool serialize; bool ipv6; }; +bool +configUseWS(const TestConfig& config) +{ + return config.protocol == "ws" || config.protocol == "wss"; +} + +bool +configUseSSL(const TestConfig& config) +{ + return config.protocol == "ssl" || config.protocol == "wss"; +} + class Runnable : public IceUtil::Thread, public Test::MainHelper { public: @@ -161,10 +173,7 @@ public: args.push_back("--Ice.ThreadPool.Server.SizeWarn=0"); } - if(_config.ssl) - { - args.push_back("--Ice.Default.Protocol=ssl"); - } + args.push_back("--Ice.Default.Protocol=" + _config.protocol); char** argv = new char*[args.size() + 1]; for(unsigned int i = 0; i < args.size(); ++i) @@ -285,8 +294,51 @@ private: }; typedef IceUtil::Handle<Runnable> RunnablePtr; +bool +isIn(const string s[], const string& name) +{ + for(int i = 0; i < sizeof(s); ++i) + { + if(s[i] == name) + { + return true; + } + } + return false; +} + +static const string noSSL[] = +{ + "udp", + "metrics" +}; + +static const string noWS[] = +{ + "metrics" +}; + +static const string noIPv6[] = +{ + "metrics" +}; + struct TestCase { + TestCase(const string& module, const string& name, const char* client, const char* server, + const char* serverAMD = 0, const char* collocated = 0) : + name(module + "\\" + name), + prefix(module + "_" + name + "_"), + client(client), + server(server), + serverAMD(serverAMD), + collocated(collocated), + sslSupport(!isIn(noSSL, name)), + ipv6Support(!isIn(noIPv6, name)), + wsSupport(!isIn(noWS, name)) + { + } + string name; string prefix; const char* client; @@ -295,35 +347,35 @@ struct TestCase const char* collocated; bool sslSupport; bool ipv6Support; + bool wsSupport; }; -} static const TestCase allTest[] = { - {"Ice\\adapterDeactivation", "Ice_adapterDeactivation_", "client.dll", "server.dll", 0, "collocated.dll", true, - true }, - {"Ice\\ami", "Ice_ami_", "client.dll", "server.dll", 0, 0, true, true }, - {"Ice\\binding", "Ice_binding_", "client.dll", "server.dll", 0, 0, true, true }, - {"Ice\\dispatcher", "Ice_dispatcher_", "client.dll", "server.dll", 0, 0, true, true }, - {"Ice\\exceptions", "Ice_exceptions_", "client.dll", "server.dll", "serveramd.dll", "collocated.dll", true, true }, - {"Ice\\facets", "Ice_facets_", "client.dll", "server.dll", 0, "collocated.dll", true, true }, - {"Ice\\hold", "Ice_hold_", "client.dll", "server.dll", 0, 0, true, true }, - {"Ice\\info", "Ice_info_", "client.dll", "server.dll", 0, 0, true, true }, - {"Ice\\inheritance", "Ice_inheritance_", "client.dll", "server.dll", 0, "collocated.dll", true, true }, - {"Ice\\invoke", "Ice_invoke_", "client.dll", "server.dll", 0, 0, true, true }, - {"Ice\\location", "Ice_location_", "client.dll", "server.dll", 0, 0, true, true }, - {"Ice\\objects", "Ice_objects_", "client.dll", "server.dll", 0, "collocated.dll", true, true }, - {"Ice\\operations", "Ice_operations_", "client.dll", "server.dll", "serveramd.dll", "collocated.dll", true, true }, - {"Ice\\proxy", "Ice_proxy_", "client.dll", "server.dll", "serveramd.dll", "collocated.dll", true, true }, - {"Ice\\retry", "Ice_retry_", "client.dll", "server.dll", 0, 0, true, true }, - {"Ice\\stream", "Ice_stream_", "client.dll", 0, 0, 0, true, true }, - {"Ice\\timeout", "Ice_timeout_", "client.dll", "server.dll", 0, 0, true, true }, - {"Ice\\udp", "Ice_udp_", "client.dll", "server.dll", 0, 0, false, true }, - {"Ice\\hash", "Ice_hash_", "client.dll", 0, 0, 0, true, true }, - {"Ice\\metrics", "Ice_metrics_", "client.dll", "server.dll", "serveramd.dll", 0, false, false }, - {"Ice\\optional", "Ice_optional_", "client.dll", "server.dll", 0, 0, true, true }, - {"Ice\\admin", "Ice_admin_", "client.dll", "server.dll", 0, 0, true, true }, - {"Ice\\enums", "Ice_enums_", "client.dll", "server.dll", 0, 0, true, true } + TestCase("Ice", "adapterDeactivation", "client.dll", "server.dll", 0, "collocated.dll"), + TestCase("Ice", "adapterDeactivation", "client.dll", "server.dll", 0, "collocated.dll"), + TestCase("Ice", "ami", "client.dll", "server.dll", 0, 0), + TestCase("Ice", "binding", "client.dll", "server.dll", 0, 0), + TestCase("Ice", "dispatcher", "client.dll", "server.dll", 0, 0), + TestCase("Ice", "exceptions", "client.dll", "server.dll", "serveramd.dll", "collocated.dll"), + TestCase("Ice", "facets", "client.dll", "server.dll", 0, "collocated.dll"), + TestCase("Ice", "hold", "client.dll", "server.dll", 0, 0), + TestCase("Ice", "info", "client.dll", "server.dll", 0, 0), + TestCase("Ice", "inheritance", "client.dll", "server.dll", 0, "collocated.dll"), + TestCase("Ice", "invoke", "client.dll", "server.dll", 0, 0), + TestCase("Ice", "location", "client.dll", "server.dll", 0, 0), + TestCase("Ice", "objects", "client.dll", "server.dll", 0, "collocated.dll"), + TestCase("Ice", "operations", "client.dll", "server.dll", "serveramd.dll", "collocated.dll"), + TestCase("Ice", "proxy", "client.dll", "server.dll", "serveramd.dll", "collocated.dll"), + TestCase("Ice", "retry", "client.dll", "server.dll", 0, 0), + TestCase("Ice", "stream", "client.dll", 0, 0, 0), + TestCase("Ice", "timeout", "client.dll", "server.dll", 0, 0), + TestCase("Ice", "udp", "client.dll", "server.dll", 0, 0), + TestCase("Ice", "hash", "client.dll", 0, 0, 0), + TestCase("Ice", "metrics", "client.dll", "server.dll", "serveramd.dll", 0), + TestCase("Ice", "optional", "client.dll", "server.dll", 0, 0), + TestCase("Ice", "admin", "client.dll", "server.dll", 0, 0), + TestCase("Ice", "enums", "client.dll", "server.dll", 0, 0), }; class TestRunner : public IceUtil::Thread @@ -339,7 +391,11 @@ public: { try { - if(_config.ssl && !_test.sslSupport) + if(configUseWS(_config) && !_test.wsSupport) + { + printLineToConsoleOutput("**** test " + _test.name + " not supported with WS"); + } + else if(configUseSSL(_config) && !_test.sslSupport) { printLineToConsoleOutput("**** test " + _test.name + " not supported with SSL"); } @@ -347,7 +403,7 @@ public: { printLineToConsoleOutput("**** test " + _test.name + " not supported with IPv6"); } - else if(_config.ssl && _config.ipv6) + else if(configUseSSL(_config) && _config.ipv6) { printLineToConsoleOutput("**** test " + _test.name + " not supported with IPv6 SSL"); } @@ -377,7 +433,7 @@ public: // // Don't run collocated tests with SSL as there isn't SSL server side. // - if(_test.collocated && !_config.ssl) + if(_test.collocated && !configUseSSL(_config)) { printLineToConsoleOutput("*** running collocated test " + _test.name); runClientTest(_test.collocated, true); @@ -409,7 +465,7 @@ public: runClientServerTest(const string& server, const string& client) { RunnablePtr serverRunable; - if(!_config.ssl) + if(!configUseSSL(_config)) { TestConfig svrConfig = _config; svrConfig.type = TestConfigTypeServer; @@ -464,6 +520,7 @@ private: typedef IceUtil::Handle<TestRunner> TestRunnerPtr; +} // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238 @@ -545,8 +602,9 @@ MainPage::btnRun_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventA void MainPage::runSelectedTest() { + static const string protocols[] = { "tcp", "ssl", "ws", "wss" }; TestConfig config; - config.ssl = chkSSL->IsChecked->Value; + config.protocol = protocols[protocol->SelectedIndex]; config.serialize = chkSerialize->IsChecked->Value; config.ipv6 = chkIPv6->IsChecked->Value; |