zeroc-ice 3.7.9.1 → 3.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/ice/cpp/include/Ice/Config.h +5 -7
- data/ext/ice/cpp/include/Ice/ConsoleUtil.h +1 -1
- data/ext/ice/cpp/include/Ice/Ice.h +2 -2
- data/ext/ice/cpp/include/Ice/SHA1.h +0 -2
- data/ext/ice/cpp/include/IceSSL/IceSSL.h +3 -7
- data/ext/ice/cpp/include/IceUtil/Config.h +12 -44
- data/ext/ice/cpp/include/IceUtil/ConsoleUtil.h +1 -1
- data/ext/ice/cpp/include/IceUtil/FileUtil.h +0 -3
- data/ext/ice/cpp/include/IceUtil/IceUtil.h +1 -1
- data/ext/ice/cpp/include/IceUtil/Mutex.h +0 -4
- data/ext/ice/cpp/include/IceUtil/ResourceConfig.h +5 -21
- data/ext/ice/cpp/include/IceUtil/Thread.h +4 -18
- data/ext/ice/cpp/include/IceUtil/Timer.h +1 -0
- data/ext/ice/cpp/include/generated/Ice/BuiltinSequences.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/Communicator.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/CommunicatorF.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/Connection.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/ConnectionF.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/Current.h +4 -4
- data/ext/ice/cpp/include/generated/Ice/Endpoint.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/EndpointF.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/EndpointTypes.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/FacetMap.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/Identity.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/ImplicitContext.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/ImplicitContextF.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/Instrumentation.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/InstrumentationF.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/LocalException.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/Locator.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/LocatorF.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/Logger.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/LoggerF.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/Metrics.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/ObjectAdapter.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/ObjectAdapterF.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/ObjectFactory.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/Plugin.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/PluginF.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/Process.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/ProcessF.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/Properties.h +8 -8
- data/ext/ice/cpp/include/generated/Ice/PropertiesAdmin.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/PropertiesF.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/RemoteLogger.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/Router.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/RouterF.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/ServantLocator.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/ServantLocatorF.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/SliceChecksumDict.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/ValueFactory.h +2 -2
- data/ext/ice/cpp/include/generated/Ice/Version.h +2 -2
- data/ext/ice/cpp/include/generated/IceSSL/ConnectionInfo.h +2 -2
- data/ext/ice/cpp/include/generated/IceSSL/ConnectionInfoF.h +2 -2
- data/ext/ice/cpp/include/generated/IceSSL/EndpointInfo.h +2 -2
- data/ext/ice/cpp/src/Ice/Acceptor.h +1 -1
- data/ext/ice/cpp/src/Ice/BuiltinSequences.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Communicator.cpp +2 -2
- data/ext/ice/cpp/src/Ice/CommunicatorF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Connection.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ConnectionF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ConnectionFactory.cpp +1 -1
- data/ext/ice/cpp/src/Ice/ConnectionFactory.h +2 -2
- data/ext/ice/cpp/src/Ice/ConnectionI.cpp +5 -5
- data/ext/ice/cpp/src/Ice/ConnectionI.h +6 -8
- data/ext/ice/cpp/src/Ice/CountDownLatch.cpp +0 -8
- data/ext/ice/cpp/src/Ice/Current.cpp +2 -2
- data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +0 -2
- data/ext/ice/cpp/src/Ice/DynamicLibrary.cpp +2 -9
- data/ext/ice/cpp/src/Ice/Endpoint.cpp +2 -2
- data/ext/ice/cpp/src/Ice/EndpointF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/EndpointTypes.cpp +2 -2
- data/ext/ice/cpp/src/Ice/EventHandler.cpp +1 -1
- data/ext/ice/cpp/src/Ice/EventHandler.h +2 -2
- data/ext/ice/cpp/src/Ice/Exception.cpp +0 -27
- data/ext/ice/cpp/src/Ice/FacetMap.cpp +2 -2
- data/ext/ice/cpp/src/Ice/IPEndpointI.cpp +0 -46
- data/ext/ice/cpp/src/Ice/IPEndpointI.h +1 -11
- data/ext/ice/cpp/src/Ice/Identity.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ImplicitContext.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ImplicitContextF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Instance.cpp +2 -6
- data/ext/ice/cpp/src/Ice/Instrumentation.cpp +2 -2
- data/ext/ice/cpp/src/Ice/InstrumentationF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/LocalException.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Locator.cpp +2 -2
- data/ext/ice/cpp/src/Ice/LocatorF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Logger.cpp +2 -2
- data/ext/ice/cpp/src/Ice/LoggerF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/LoggerI.cpp +1 -3
- data/ext/ice/cpp/src/Ice/Metrics.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Network.cpp +15 -841
- data/ext/ice/cpp/src/Ice/Network.h +4 -86
- data/ext/ice/cpp/src/Ice/NetworkF.h +0 -4
- data/ext/ice/cpp/src/Ice/NetworkProxy.cpp +0 -13
- data/ext/ice/cpp/src/Ice/ObjectAdapter.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ObjectAdapterF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ObjectFactory.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Plugin.cpp +2 -2
- data/ext/ice/cpp/src/Ice/PluginF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Process.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ProcessF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Properties.cpp +2 -2
- data/ext/ice/cpp/src/Ice/PropertiesAdmin.cpp +2 -2
- data/ext/ice/cpp/src/Ice/PropertiesF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/PropertiesI.cpp +4 -12
- data/ext/ice/cpp/src/Ice/RemoteLogger.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Router.cpp +2 -2
- data/ext/ice/cpp/src/Ice/RouterF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/SHA1.cpp +27 -43
- data/ext/ice/cpp/src/Ice/Selector.cpp +1 -13
- data/ext/ice/cpp/src/Ice/Selector.h +1 -17
- data/ext/ice/cpp/src/Ice/ServantLocator.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ServantLocatorF.cpp +2 -2
- data/ext/ice/cpp/src/Ice/SliceChecksumDict.cpp +2 -2
- data/ext/ice/cpp/src/Ice/StreamSocket.cpp +4 -167
- data/ext/ice/cpp/src/Ice/StreamSocket.h +3 -10
- data/ext/ice/cpp/src/Ice/TcpAcceptor.cpp +0 -121
- data/ext/ice/cpp/src/Ice/TcpAcceptor.h +2 -10
- data/ext/ice/cpp/src/Ice/TcpTransceiver.cpp +1 -1
- data/ext/ice/cpp/src/Ice/TcpTransceiver.h +1 -1
- data/ext/ice/cpp/src/Ice/Thread.cpp +1 -243
- data/ext/ice/cpp/src/Ice/ThreadPool.cpp +15 -51
- data/ext/ice/cpp/src/Ice/ThreadPool.h +6 -6
- data/ext/ice/cpp/src/Ice/Transceiver.h +1 -1
- data/ext/ice/cpp/src/Ice/UdpConnector.cpp +0 -5
- data/ext/ice/cpp/src/Ice/UdpTransceiver.cpp +13 -360
- data/ext/ice/cpp/src/Ice/UdpTransceiver.h +2 -23
- data/ext/ice/cpp/src/Ice/ValueFactory.cpp +2 -2
- data/ext/ice/cpp/src/Ice/Version.cpp +2 -2
- data/ext/ice/cpp/src/Ice/WSAcceptor.cpp +2 -2
- data/ext/ice/cpp/src/Ice/WSAcceptor.h +2 -2
- data/ext/ice/cpp/src/Ice/WSTransceiver.cpp +2 -45
- data/ext/ice/cpp/src/Ice/WSTransceiver.h +2 -2
- data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.cpp +2 -2
- data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.h +2 -2
- data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.cpp +2 -2
- data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.h +2 -2
- data/ext/ice/cpp/src/IceSSL/AcceptorI.cpp +2 -2
- data/ext/ice/cpp/src/IceSSL/AcceptorI.h +2 -2
- data/ext/ice/cpp/src/IceSSL/ConnectionInfo.cpp +2 -2
- data/ext/ice/cpp/src/IceSSL/ConnectionInfoF.cpp +2 -2
- data/ext/ice/cpp/src/IceSSL/EndpointInfo.cpp +2 -2
- data/ext/ice/cpp/src/IceSSL/Util.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/ConsoleUtil.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/FileUtil.cpp +4 -17
- data/ext/ice/cpp/src/IceUtil/RecMutex.cpp +0 -4
- data/ext/ice/cpp/src/IceUtil/StringUtil.cpp +0 -45
- data/ext/ice/cpp/src/IceUtil/UUID.cpp +2 -6
- data/ext/ice/cpp/src/IceUtil/UtilException.cpp +1 -1
- data/ext/ice/cpp/src/Slice/JavaUtil.cpp +22 -0
- data/ext/ice/cpp/src/Slice/JavaUtil.h +9 -0
- data/ext/ice/mcpp/system.c +0 -4
- data/ice.gemspec +1 -1
- data/lib/Glacier2/Metrics.rb +1 -1
- data/lib/Glacier2/PermissionsVerifier.rb +1 -1
- data/lib/Glacier2/PermissionsVerifierF.rb +1 -1
- data/lib/Glacier2/Router.rb +1 -1
- data/lib/Glacier2/RouterF.rb +1 -1
- data/lib/Glacier2/SSLInfo.rb +1 -1
- data/lib/Glacier2/Session.rb +1 -1
- data/lib/Ice/BuiltinSequences.rb +1 -1
- data/lib/Ice/Communicator.rb +1 -1
- data/lib/Ice/CommunicatorF.rb +1 -1
- data/lib/Ice/Connection.rb +1 -1
- data/lib/Ice/ConnectionF.rb +1 -1
- data/lib/Ice/Current.rb +1 -1
- data/lib/Ice/Endpoint.rb +1 -1
- data/lib/Ice/EndpointF.rb +1 -1
- data/lib/Ice/EndpointTypes.rb +1 -1
- data/lib/Ice/FacetMap.rb +1 -1
- data/lib/Ice/Identity.rb +1 -1
- data/lib/Ice/ImplicitContext.rb +1 -1
- data/lib/Ice/ImplicitContextF.rb +1 -1
- data/lib/Ice/Instrumentation.rb +1 -1
- data/lib/Ice/InstrumentationF.rb +1 -1
- data/lib/Ice/LocalException.rb +1 -1
- data/lib/Ice/Locator.rb +1 -1
- data/lib/Ice/LocatorF.rb +1 -1
- data/lib/Ice/Logger.rb +1 -1
- data/lib/Ice/LoggerF.rb +1 -1
- data/lib/Ice/Metrics.rb +1 -1
- data/lib/Ice/ObjectAdapter.rb +1 -1
- data/lib/Ice/ObjectAdapterF.rb +1 -1
- data/lib/Ice/ObjectFactory.rb +1 -1
- data/lib/Ice/Plugin.rb +1 -1
- data/lib/Ice/PluginF.rb +1 -1
- data/lib/Ice/Process.rb +1 -1
- data/lib/Ice/ProcessF.rb +1 -1
- data/lib/Ice/Properties.rb +1 -1
- data/lib/Ice/PropertiesAdmin.rb +1 -1
- data/lib/Ice/PropertiesF.rb +1 -1
- data/lib/Ice/RemoteLogger.rb +1 -1
- data/lib/Ice/Router.rb +1 -1
- data/lib/Ice/RouterF.rb +1 -1
- data/lib/Ice/ServantLocator.rb +1 -1
- data/lib/Ice/ServantLocatorF.rb +1 -1
- data/lib/Ice/SliceChecksumDict.rb +1 -1
- data/lib/Ice/ValueFactory.rb +1 -1
- data/lib/Ice/Version.rb +1 -1
- data/lib/IceBox/IceBox.rb +1 -1
- data/lib/IceGrid/Admin.rb +1 -1
- data/lib/IceGrid/Descriptor.rb +1 -1
- data/lib/IceGrid/Exception.rb +1 -1
- data/lib/IceGrid/FileParser.rb +1 -1
- data/lib/IceGrid/PluginFacade.rb +1 -1
- data/lib/IceGrid/Registry.rb +1 -1
- data/lib/IceGrid/Session.rb +1 -1
- data/lib/IceGrid/UserAccountMapper.rb +1 -1
- data/lib/IcePatch2/FileInfo.rb +1 -1
- data/lib/IcePatch2/FileServer.rb +1 -1
- data/lib/IceStorm/IceStorm.rb +1 -1
- data/lib/IceStorm/Metrics.rb +1 -1
- data/slice/Ice/Current.ice +1 -1
- data/slice/Ice/Properties.ice +3 -3
- metadata +3 -3
@@ -24,13 +24,7 @@ struct timespec zeroTimeout = { 0, 0 };
|
|
24
24
|
}
|
25
25
|
#endif
|
26
26
|
|
27
|
-
#if defined(
|
28
|
-
using namespace Windows::Storage::Streams;
|
29
|
-
using namespace Windows::Networking;
|
30
|
-
using namespace Windows::Networking::Sockets;
|
31
|
-
#endif
|
32
|
-
|
33
|
-
#if defined(ICE_USE_IOCP) || defined(ICE_OS_UWP)
|
27
|
+
#if defined(ICE_USE_IOCP)
|
34
28
|
|
35
29
|
Selector::Selector(const InstancePtr& instance) : _instance(instance)
|
36
30
|
{
|
@@ -116,12 +110,6 @@ Selector::update(EventHandler* handler, SocketOperation remove, SocketOperation
|
|
116
110
|
void
|
117
111
|
Selector::finish(IceInternal::EventHandler* handler)
|
118
112
|
{
|
119
|
-
#ifdef ICE_OS_UWP
|
120
|
-
// If async operations are no longer pending, clear the completion handler to break
|
121
|
-
// the cyclic reference count.
|
122
|
-
assert(!handler->_started && !handler->_pending);
|
123
|
-
handler->getNativeInfo()->setCompletedHandler(nullptr);
|
124
|
-
#endif
|
125
113
|
handler->_registered = SocketOperationNone;
|
126
114
|
handler->_finish = false; // Ensures that finished() is only called once on the event handler.
|
127
115
|
}
|
@@ -39,10 +39,6 @@ struct __CFSocket;
|
|
39
39
|
typedef struct __CFSocket * CFSocketRef;
|
40
40
|
#endif
|
41
41
|
|
42
|
-
#if defined(ICE_OS_UWP)
|
43
|
-
# include <deque>
|
44
|
-
#endif
|
45
|
-
|
46
42
|
namespace IceInternal
|
47
43
|
{
|
48
44
|
|
@@ -53,22 +49,10 @@ class SelectorTimeoutException
|
|
53
49
|
{
|
54
50
|
};
|
55
51
|
|
56
|
-
#if defined(ICE_USE_IOCP)
|
52
|
+
#if defined(ICE_USE_IOCP)
|
57
53
|
|
58
54
|
class Selector
|
59
55
|
{
|
60
|
-
#if defined(ICE_OS_UWP)
|
61
|
-
struct SelectEvent
|
62
|
-
{
|
63
|
-
SelectEvent(const EventHandlerPtr& handler, SocketOperation status) : handler(handler), status(status)
|
64
|
-
{
|
65
|
-
}
|
66
|
-
|
67
|
-
EventHandlerPtr handler;
|
68
|
-
SocketOperation status;
|
69
|
-
};
|
70
|
-
#endif
|
71
|
-
|
72
56
|
public:
|
73
57
|
|
74
58
|
Selector(const InstancePtr&);
|
@@ -2,7 +2,7 @@
|
|
2
2
|
// Copyright (c) ZeroC, Inc. All rights reserved.
|
3
3
|
//
|
4
4
|
//
|
5
|
-
// Ice version 3.7.
|
5
|
+
// Ice version 3.7.10
|
6
6
|
//
|
7
7
|
// <auto-generated>
|
8
8
|
//
|
@@ -37,7 +37,7 @@
|
|
37
37
|
# if ICE_INT_VERSION % 100 >= 50
|
38
38
|
# error Beta header file detected
|
39
39
|
# endif
|
40
|
-
# if ICE_INT_VERSION % 100 <
|
40
|
+
# if ICE_INT_VERSION % 100 < 10
|
41
41
|
# error Ice patch level mismatch!
|
42
42
|
# endif
|
43
43
|
#endif
|
@@ -2,7 +2,7 @@
|
|
2
2
|
// Copyright (c) ZeroC, Inc. All rights reserved.
|
3
3
|
//
|
4
4
|
//
|
5
|
-
// Ice version 3.7.
|
5
|
+
// Ice version 3.7.10
|
6
6
|
//
|
7
7
|
// <auto-generated>
|
8
8
|
//
|
@@ -35,7 +35,7 @@
|
|
35
35
|
# if ICE_INT_VERSION % 100 >= 50
|
36
36
|
# error Beta header file detected
|
37
37
|
# endif
|
38
|
-
# if ICE_INT_VERSION % 100 <
|
38
|
+
# if ICE_INT_VERSION % 100 < 10
|
39
39
|
# error Ice patch level mismatch!
|
40
40
|
# endif
|
41
41
|
#endif
|
@@ -2,7 +2,7 @@
|
|
2
2
|
// Copyright (c) ZeroC, Inc. All rights reserved.
|
3
3
|
//
|
4
4
|
//
|
5
|
-
// Ice version 3.7.
|
5
|
+
// Ice version 3.7.10
|
6
6
|
//
|
7
7
|
// <auto-generated>
|
8
8
|
//
|
@@ -37,7 +37,7 @@
|
|
37
37
|
# if ICE_INT_VERSION % 100 >= 50
|
38
38
|
# error Beta header file detected
|
39
39
|
# endif
|
40
|
-
# if ICE_INT_VERSION % 100 <
|
40
|
+
# if ICE_INT_VERSION % 100 < 10
|
41
41
|
# error Ice patch level mismatch!
|
42
42
|
# endif
|
43
43
|
#endif
|
@@ -8,13 +8,6 @@
|
|
8
8
|
|
9
9
|
using namespace IceInternal;
|
10
10
|
|
11
|
-
#if defined(ICE_OS_UWP)
|
12
|
-
|
13
|
-
#include <Ice/Properties.h>
|
14
|
-
using namespace Platform;
|
15
|
-
using namespace Windows::Foundation;
|
16
|
-
#endif
|
17
|
-
|
18
11
|
StreamSocket::StreamSocket(const ProtocolInstancePtr& instance,
|
19
12
|
const NetworkProxyPtr& proxy,
|
20
13
|
const Address& addr,
|
@@ -30,7 +23,7 @@ StreamSocket::StreamSocket(const ProtocolInstancePtr& instance,
|
|
30
23
|
#endif
|
31
24
|
{
|
32
25
|
init();
|
33
|
-
#if !defined(ICE_USE_IOCP)
|
26
|
+
#if !defined(ICE_USE_IOCP)
|
34
27
|
if(doConnect(_fd, _proxy ? _proxy->getAddress() : _addr, sourceAddr))
|
35
28
|
{
|
36
29
|
_state = _proxy ? StateProxyWrite : StateConnected;
|
@@ -86,24 +79,6 @@ StreamSocket::connect(Buffer& readBuffer, Buffer& writeBuffer)
|
|
86
79
|
{
|
87
80
|
#if defined(ICE_USE_IOCP)
|
88
81
|
doFinishConnectAsync(_fd, _write);
|
89
|
-
#elif defined(ICE_OS_UWP)
|
90
|
-
if(_write.error != ERROR_SUCCESS)
|
91
|
-
{
|
92
|
-
try
|
93
|
-
{
|
94
|
-
checkConnectErrorCode(__FILE__, __LINE__, _write.error);
|
95
|
-
}
|
96
|
-
catch(Ice::DNSException& ex)
|
97
|
-
{
|
98
|
-
//
|
99
|
-
// Don't need to pass a wide string converter as the wide string come from
|
100
|
-
// Windows API.
|
101
|
-
//
|
102
|
-
const Address& addr = _proxy ? _proxy->getAddress() : _addr;
|
103
|
-
ex.host = wstringToString(addr.host->RawName->Data(), Ice::getProcessStringConverter());
|
104
|
-
throw;
|
105
|
-
}
|
106
|
-
}
|
107
82
|
#else
|
108
83
|
doFinishConnect(_fd);
|
109
84
|
#endif
|
@@ -147,7 +122,7 @@ StreamSocket::isConnected()
|
|
147
122
|
size_t
|
148
123
|
StreamSocket::getSendPacketSize(size_t length)
|
149
124
|
{
|
150
|
-
#if defined(ICE_USE_IOCP)
|
125
|
+
#if defined(ICE_USE_IOCP)
|
151
126
|
return _maxSendPacketSize > 0 ? std::min(length, _maxSendPacketSize) : length;
|
152
127
|
#else
|
153
128
|
return length;
|
@@ -157,7 +132,7 @@ StreamSocket::getSendPacketSize(size_t length)
|
|
157
132
|
size_t
|
158
133
|
StreamSocket::getRecvPacketSize(size_t length)
|
159
134
|
{
|
160
|
-
#if defined(ICE_USE_IOCP)
|
135
|
+
#if defined(ICE_USE_IOCP)
|
161
136
|
return _maxRecvPacketSize > 0 ? std::min(length, _maxRecvPacketSize) : length;
|
162
137
|
#else
|
163
138
|
return length;
|
@@ -173,7 +148,6 @@ StreamSocket::setBufferSize(int rcvSize, int sndSize)
|
|
173
148
|
SocketOperation
|
174
149
|
StreamSocket::read(Buffer& buf)
|
175
150
|
{
|
176
|
-
#if !defined(ICE_OS_UWP)
|
177
151
|
if(_state == StateProxyRead)
|
178
152
|
{
|
179
153
|
while(true)
|
@@ -192,14 +166,12 @@ StreamSocket::read(Buffer& buf)
|
|
192
166
|
}
|
193
167
|
}
|
194
168
|
buf.i += read(reinterpret_cast<char*>(&*buf.i), static_cast<size_t>(buf.b.end() - buf.i));
|
195
|
-
#endif
|
196
169
|
return buf.i != buf.b.end() ? SocketOperationRead : SocketOperationNone;
|
197
170
|
}
|
198
171
|
|
199
172
|
SocketOperation
|
200
173
|
StreamSocket::write(Buffer& buf)
|
201
174
|
{
|
202
|
-
#if !defined(ICE_OS_UWP)
|
203
175
|
if(_state == StateProxyWrite)
|
204
176
|
{
|
205
177
|
while(true)
|
@@ -218,11 +190,9 @@ StreamSocket::write(Buffer& buf)
|
|
218
190
|
}
|
219
191
|
}
|
220
192
|
buf.i += write(reinterpret_cast<const char*>(&*buf.i), static_cast<size_t>(buf.b.end() - buf.i));
|
221
|
-
#endif
|
222
193
|
return buf.i != buf.b.end() ? SocketOperationWrite : SocketOperationNone;
|
223
194
|
}
|
224
195
|
|
225
|
-
#if !defined(ICE_OS_UWP)
|
226
196
|
ssize_t
|
227
197
|
StreamSocket::read(char* buf, size_t length)
|
228
198
|
{
|
@@ -348,9 +318,8 @@ StreamSocket::write(const char* buf, size_t length)
|
|
348
318
|
}
|
349
319
|
return sent;
|
350
320
|
}
|
351
|
-
#endif
|
352
321
|
|
353
|
-
#if defined(ICE_USE_IOCP)
|
322
|
+
#if defined(ICE_USE_IOCP)
|
354
323
|
AsyncInfo*
|
355
324
|
StreamSocket::getAsyncInfo(SocketOperation op)
|
356
325
|
{
|
@@ -492,120 +461,6 @@ StreamSocket::finishRead(Buffer& buf)
|
|
492
461
|
|
493
462
|
}
|
494
463
|
|
495
|
-
#elif defined(ICE_OS_UWP)
|
496
|
-
|
497
|
-
bool
|
498
|
-
StreamSocket::startWrite(Buffer& buf)
|
499
|
-
{
|
500
|
-
if(_state == StateConnectPending)
|
501
|
-
{
|
502
|
-
const Address& addr = _proxy ? _proxy->getAddress() : _addr;
|
503
|
-
try
|
504
|
-
{
|
505
|
-
try
|
506
|
-
{
|
507
|
-
queueAction(SocketOperationConnect,
|
508
|
-
safe_cast<Windows::Networking::Sockets::StreamSocket^>(_fd)->ConnectAsync(
|
509
|
-
addr.host, addr.port,
|
510
|
-
Windows::Networking::Sockets::SocketProtectionLevel::PlainSocket), true);
|
511
|
-
}
|
512
|
-
catch(Platform::Exception^ ex)
|
513
|
-
{
|
514
|
-
checkConnectErrorCode(__FILE__, __LINE__, ex->HResult);
|
515
|
-
}
|
516
|
-
}
|
517
|
-
catch(Ice::DNSException& ex)
|
518
|
-
{
|
519
|
-
//
|
520
|
-
// Don't need to pass a wide string converter as the wide string come from
|
521
|
-
// Windows API.
|
522
|
-
//
|
523
|
-
ex.host = wstringToString(addr.host->RawName->Data(), Ice::getProcessStringConverter());
|
524
|
-
throw;
|
525
|
-
}
|
526
|
-
return false;
|
527
|
-
}
|
528
|
-
|
529
|
-
assert(!buf.b.empty());
|
530
|
-
assert(buf.i != buf.b.end());
|
531
|
-
|
532
|
-
size_t packetSize = getSendPacketSize(buf.b.end() - buf.i);
|
533
|
-
_writer->WriteBytes(ref new Array<unsigned char>(&*buf.i, static_cast<unsigned int>(packetSize)));
|
534
|
-
try
|
535
|
-
{
|
536
|
-
queueOperation(SocketOperationWrite, _writer->StoreAsync());
|
537
|
-
}
|
538
|
-
catch(Platform::Exception^ ex)
|
539
|
-
{
|
540
|
-
checkErrorCode(__FILE__, __LINE__, ex->HResult);
|
541
|
-
}
|
542
|
-
return packetSize == static_cast<size_t>(buf.b.end() - buf.i);
|
543
|
-
}
|
544
|
-
|
545
|
-
void
|
546
|
-
StreamSocket::finishWrite(Buffer& buf)
|
547
|
-
{
|
548
|
-
_write.operation = nullptr; // Must be cleared with the connection lock held
|
549
|
-
if(_fd == INVALID_SOCKET || (_state < StateConnected && _state != StateProxyWrite))
|
550
|
-
{
|
551
|
-
return;
|
552
|
-
}
|
553
|
-
|
554
|
-
if(_write.error != ERROR_SUCCESS)
|
555
|
-
{
|
556
|
-
checkErrorCode(__FILE__, __LINE__, _write.error);
|
557
|
-
}
|
558
|
-
|
559
|
-
buf.i += _write.count;
|
560
|
-
}
|
561
|
-
|
562
|
-
void
|
563
|
-
StreamSocket::startRead(Buffer& buf)
|
564
|
-
{
|
565
|
-
assert(!buf.b.empty() && buf.i != buf.b.end());
|
566
|
-
size_t packetSize = getRecvPacketSize(buf.b.end() - buf.i);
|
567
|
-
try
|
568
|
-
{
|
569
|
-
queueOperation(SocketOperationRead, _reader->LoadAsync(static_cast<unsigned int>(packetSize)));
|
570
|
-
}
|
571
|
-
catch(Platform::Exception^ ex)
|
572
|
-
{
|
573
|
-
checkErrorCode(__FILE__, __LINE__, ex->HResult);
|
574
|
-
}
|
575
|
-
}
|
576
|
-
|
577
|
-
void
|
578
|
-
StreamSocket::finishRead(Buffer& buf)
|
579
|
-
{
|
580
|
-
_read.operation = nullptr; // Must be cleared with the connection lock held
|
581
|
-
if(_fd == INVALID_SOCKET)
|
582
|
-
{
|
583
|
-
return;
|
584
|
-
}
|
585
|
-
|
586
|
-
if(_read.error != ERROR_SUCCESS)
|
587
|
-
{
|
588
|
-
checkErrorCode(__FILE__, __LINE__, _read.error);
|
589
|
-
}
|
590
|
-
else if(_read.count == 0)
|
591
|
-
{
|
592
|
-
throw Ice::ConnectionLostException(__FILE__, __LINE__, 0);
|
593
|
-
}
|
594
|
-
|
595
|
-
try
|
596
|
-
{
|
597
|
-
auto data = ref new Platform::Array<unsigned char>(_read.count);
|
598
|
-
_reader->ReadBytes(data);
|
599
|
-
memcpy(&*buf.i, data->Data, _read.count);
|
600
|
-
}
|
601
|
-
catch(Platform::Exception^ ex)
|
602
|
-
{
|
603
|
-
checkErrorCode(__FILE__, __LINE__, ex->HResult);
|
604
|
-
}
|
605
|
-
|
606
|
-
buf.i += _read.count;
|
607
|
-
}
|
608
|
-
|
609
464
|
#endif
|
610
465
|
|
611
466
|
void
|
@@ -614,16 +469,6 @@ StreamSocket::close()
|
|
614
469
|
assert(_fd != INVALID_SOCKET);
|
615
470
|
try
|
616
471
|
{
|
617
|
-
#if defined(ICE_OS_UWP)
|
618
|
-
if(_read.operation)
|
619
|
-
{
|
620
|
-
_read.operation->Cancel();
|
621
|
-
}
|
622
|
-
if(_write.operation)
|
623
|
-
{
|
624
|
-
_write.operation->Cancel();
|
625
|
-
}
|
626
|
-
#endif
|
627
472
|
closeSocket(_fd);
|
628
473
|
_fd = INVALID_SOCKET;
|
629
474
|
}
|
@@ -656,14 +501,6 @@ StreamSocket::init()
|
|
656
501
|
//
|
657
502
|
_maxSendPacketSize = std::max(512, IceInternal::getSendBufferSize(_fd));
|
658
503
|
_maxRecvPacketSize = std::max(512, IceInternal::getRecvBufferSize(_fd));
|
659
|
-
#elif defined(ICE_OS_UWP)
|
660
|
-
Windows::Networking::Sockets::StreamSocket^ s = safe_cast<Windows::Networking::Sockets::StreamSocket^>(_fd);
|
661
|
-
_writer = ref new Windows::Storage::Streams::DataWriter(s->OutputStream);
|
662
|
-
_reader = ref new Windows::Storage::Streams::DataReader(s->InputStream);
|
663
|
-
_reader->InputStreamOptions = Windows::Storage::Streams::InputStreamOptions::Partial;
|
664
|
-
|
665
|
-
_maxSendPacketSize = std::max(static_cast<unsigned int>(512), s->Control->OutboundBufferSizeInBytes / 2);
|
666
|
-
_maxRecvPacketSize = _instance->properties()->getPropertyAsIntWithDefault("Ice.TCP.RcvSize", 128 * 1024);
|
667
504
|
#endif
|
668
505
|
}
|
669
506
|
|
@@ -31,16 +31,14 @@ public:
|
|
31
31
|
SocketOperation read(Buffer&);
|
32
32
|
SocketOperation write(Buffer&);
|
33
33
|
|
34
|
-
#if !defined(ICE_OS_UWP)
|
35
34
|
ssize_t read(char*, size_t);
|
36
35
|
ssize_t write(const char*, size_t);
|
37
|
-
#endif
|
38
36
|
|
39
|
-
#if defined(ICE_USE_IOCP)
|
37
|
+
#if defined(ICE_USE_IOCP)
|
40
38
|
AsyncInfo* getAsyncInfo(SocketOperation);
|
41
39
|
#endif
|
42
40
|
|
43
|
-
#if defined(ICE_USE_IOCP)
|
41
|
+
#if defined(ICE_USE_IOCP)
|
44
42
|
bool startWrite(Buffer&);
|
45
43
|
void finishWrite(Buffer&);
|
46
44
|
void startRead(Buffer&);
|
@@ -73,17 +71,12 @@ private:
|
|
73
71
|
State _state;
|
74
72
|
std::string _desc;
|
75
73
|
|
76
|
-
#if defined(ICE_USE_IOCP)
|
74
|
+
#if defined(ICE_USE_IOCP)
|
77
75
|
size_t _maxSendPacketSize;
|
78
76
|
size_t _maxRecvPacketSize;
|
79
77
|
AsyncInfo _read;
|
80
78
|
AsyncInfo _write;
|
81
79
|
#endif
|
82
|
-
|
83
|
-
#if defined(ICE_OS_UWP)
|
84
|
-
Windows::Storage::Streams::DataReader^ _reader;
|
85
|
-
Windows::Storage::Streams::DataWriter^ _writer;
|
86
|
-
#endif
|
87
80
|
};
|
88
81
|
typedef IceUtil::Handle<StreamSocket> StreamSocketPtr;
|
89
82
|
|
@@ -18,12 +18,6 @@
|
|
18
18
|
|
19
19
|
#if defined(ICE_USE_IOCP)
|
20
20
|
# include <Mswsock.h>
|
21
|
-
#elif defined(ICE_OS_UWP)
|
22
|
-
using namespace Platform;
|
23
|
-
using namespace Windows::Foundation;
|
24
|
-
using namespace Windows::Storage::Streams;
|
25
|
-
using namespace Windows::Networking;
|
26
|
-
using namespace Windows::Networking::Sockets;
|
27
21
|
#endif
|
28
22
|
|
29
23
|
//
|
@@ -48,25 +42,6 @@ IceInternal::TcpAcceptor::getNativeInfo()
|
|
48
42
|
void
|
49
43
|
IceInternal::TcpAcceptor::close()
|
50
44
|
{
|
51
|
-
#if defined(ICE_OS_UWP)
|
52
|
-
IceUtil::Mutex::Lock lock(_mutex);
|
53
|
-
if(_acceptPending)
|
54
|
-
{
|
55
|
-
assert(_accepted.empty());
|
56
|
-
completed(SocketOperationRead);
|
57
|
-
_acceptPending = false;
|
58
|
-
}
|
59
|
-
else if(!_accepted.empty())
|
60
|
-
{
|
61
|
-
for(deque<Windows::Networking::Sockets::StreamSocket^>::const_iterator p = _accepted.begin();
|
62
|
-
p != _accepted.end(); ++p)
|
63
|
-
{
|
64
|
-
closeSocket(*p);
|
65
|
-
}
|
66
|
-
_accepted.clear();
|
67
|
-
}
|
68
|
-
#endif
|
69
|
-
|
70
45
|
#if defined(ICE_USE_IOCP)
|
71
46
|
if(_acceptFd != INVALID_SOCKET)
|
72
47
|
{
|
@@ -87,9 +62,7 @@ IceInternal::TcpAcceptor::listen()
|
|
87
62
|
try
|
88
63
|
{
|
89
64
|
const_cast<Address&>(_addr) = doBind(_fd, _addr);
|
90
|
-
#if !defined(ICE_OS_UWP)
|
91
65
|
doListen(_fd, _backlog);
|
92
|
-
#endif
|
93
66
|
}
|
94
67
|
catch(...)
|
95
68
|
{
|
@@ -170,70 +143,6 @@ IceInternal::TcpAcceptor::accept()
|
|
170
143
|
_acceptFd = INVALID_SOCKET;
|
171
144
|
return new TcpTransceiver(_instance, new StreamSocket(_instance, fd));
|
172
145
|
}
|
173
|
-
|
174
|
-
#elif defined(ICE_OS_UWP)
|
175
|
-
|
176
|
-
AsyncInfo*
|
177
|
-
IceInternal::TcpAcceptor::getAsyncInfo(SocketOperation)
|
178
|
-
{
|
179
|
-
return 0; // Not used
|
180
|
-
}
|
181
|
-
|
182
|
-
void
|
183
|
-
IceInternal::TcpAcceptor::startAccept()
|
184
|
-
{
|
185
|
-
assert(_fd != INVALID_SOCKET);
|
186
|
-
|
187
|
-
//
|
188
|
-
// If there are already sockets waiting to be accepted, we just
|
189
|
-
// notify the selector that the acceptor is ready for acceting the
|
190
|
-
// new socket. Otherwise, we set the _acceptPending flag, when a
|
191
|
-
// new socket connection event is received, the message handler
|
192
|
-
// will notify the selector.
|
193
|
-
//
|
194
|
-
IceUtil::Mutex::Lock lock(_mutex);
|
195
|
-
assert(!_acceptPending);
|
196
|
-
if(!_accepted.empty())
|
197
|
-
{
|
198
|
-
completed(SocketOperationRead);
|
199
|
-
}
|
200
|
-
else
|
201
|
-
{
|
202
|
-
_acceptPending = true;
|
203
|
-
}
|
204
|
-
}
|
205
|
-
|
206
|
-
void
|
207
|
-
IceInternal::TcpAcceptor::finishAccept()
|
208
|
-
{
|
209
|
-
//
|
210
|
-
// Nothing to do, we just check there's at least one accepted
|
211
|
-
// socket or the acceptor was closed.
|
212
|
-
//
|
213
|
-
IceUtil::Mutex::Lock lock(_mutex);
|
214
|
-
assert(!_acceptPending && (!_accepted.empty() || _fd == INVALID_SOCKET));
|
215
|
-
}
|
216
|
-
|
217
|
-
TransceiverPtr
|
218
|
-
IceInternal::TcpAcceptor::accept()
|
219
|
-
{
|
220
|
-
if(_fd == INVALID_SOCKET) // Acceptor closed.
|
221
|
-
{
|
222
|
-
assert(_accepted.empty());
|
223
|
-
throw SocketException(__FILE__, __LINE__);
|
224
|
-
}
|
225
|
-
|
226
|
-
Windows::Networking::Sockets::StreamSocket^ fd;
|
227
|
-
{
|
228
|
-
IceUtil::Mutex::Lock lock(_mutex);
|
229
|
-
assert(!_accepted.empty());
|
230
|
-
fd = _accepted.front();
|
231
|
-
_accepted.pop_front();
|
232
|
-
}
|
233
|
-
|
234
|
-
return new TcpTransceiver(_instance, new StreamSocket(_instance, fd));
|
235
|
-
}
|
236
|
-
|
237
146
|
#else
|
238
147
|
|
239
148
|
TransceiverPtr
|
@@ -288,37 +197,7 @@ IceInternal::TcpAcceptor::TcpAcceptor(const TcpEndpointIPtr& endpoint,
|
|
288
197
|
#endif
|
289
198
|
{
|
290
199
|
_backlog = instance->properties()->getPropertyAsIntWithDefault("Ice.TCP.Backlog", SOMAXCONN);
|
291
|
-
|
292
|
-
#if defined(ICE_OS_UWP)
|
293
|
-
_fd = ref new StreamSocketListener();
|
294
|
-
safe_cast<StreamSocketListener^>(_fd)->ConnectionReceived +=
|
295
|
-
ref new TypedEventHandler<StreamSocketListener^, StreamSocketListenerConnectionReceivedEventArgs^>(
|
296
|
-
[=](StreamSocketListener^, StreamSocketListenerConnectionReceivedEventArgs^ args)
|
297
|
-
{
|
298
|
-
IceUtil::Mutex::Lock lock(_mutex);
|
299
|
-
if(_fd == INVALID_SOCKET) // Acceptor was closed.
|
300
|
-
{
|
301
|
-
closeSocket(args->Socket);
|
302
|
-
return;
|
303
|
-
}
|
304
|
-
_accepted.push_back(args->Socket);
|
305
|
-
|
306
|
-
//
|
307
|
-
// If the acceptor is waiting for a socket to be accepted, notify
|
308
|
-
// the selector that the acceptor is ready for "read". This will
|
309
|
-
// in turn caused finishAccept() and accept() to be called by the
|
310
|
-
// thread pool. If the acceptor isn't ready to accept the socket,
|
311
|
-
// it is just queued, when startAccept is called it will be dequed.
|
312
|
-
//
|
313
|
-
if(_acceptPending)
|
314
|
-
{
|
315
|
-
completed(SocketOperationRead);
|
316
|
-
_acceptPending = false;
|
317
|
-
}
|
318
|
-
});
|
319
|
-
#else
|
320
200
|
_fd = createServerSocket(false, _addr, instance->protocolSupport());
|
321
|
-
#endif
|
322
201
|
|
323
202
|
#ifdef ICE_USE_IOCP
|
324
203
|
_acceptBuf.resize((sizeof(sockaddr_storage) + 16) * 2);
|
@@ -10,10 +10,6 @@
|
|
10
10
|
#include <Ice/Acceptor.h>
|
11
11
|
#include <Ice/Network.h>
|
12
12
|
|
13
|
-
#if defined(ICE_OS_UWP)
|
14
|
-
#include <deque>
|
15
|
-
#endif
|
16
|
-
|
17
13
|
namespace IceInternal
|
18
14
|
{
|
19
15
|
|
@@ -24,13 +20,13 @@ class TcpAcceptor : public Acceptor, public NativeInfo
|
|
24
20
|
public:
|
25
21
|
|
26
22
|
virtual NativeInfoPtr getNativeInfo();
|
27
|
-
#if defined(ICE_USE_IOCP)
|
23
|
+
#if defined(ICE_USE_IOCP)
|
28
24
|
virtual AsyncInfo* getAsyncInfo(SocketOperation);
|
29
25
|
#endif
|
30
26
|
|
31
27
|
virtual void close();
|
32
28
|
virtual EndpointIPtr listen();
|
33
|
-
#if defined(ICE_USE_IOCP)
|
29
|
+
#if defined(ICE_USE_IOCP)
|
34
30
|
virtual void startAccept();
|
35
31
|
virtual void finishAccept();
|
36
32
|
#endif
|
@@ -58,10 +54,6 @@ private:
|
|
58
54
|
int _acceptError;
|
59
55
|
std::vector<char> _acceptBuf;
|
60
56
|
AsyncInfo _info;
|
61
|
-
#elif defined(ICE_OS_UWP)
|
62
|
-
IceUtil::Mutex _mutex;
|
63
|
-
bool _acceptPending;
|
64
|
-
std::deque<Windows::Networking::Sockets::StreamSocket^> _accepted;
|
65
57
|
#endif
|
66
58
|
};
|
67
59
|
|
@@ -28,7 +28,7 @@ public:
|
|
28
28
|
virtual void close();
|
29
29
|
virtual SocketOperation write(Buffer&);
|
30
30
|
virtual SocketOperation read(Buffer&);
|
31
|
-
#if defined(ICE_USE_IOCP)
|
31
|
+
#if defined(ICE_USE_IOCP)
|
32
32
|
virtual bool startWrite(Buffer&);
|
33
33
|
virtual void finishWrite(Buffer&);
|
34
34
|
virtual void startRead(Buffer&);
|