summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ConnectionFactory.cpp
diff options
context:
space:
mode:
authorJoe George <joe@zeroc.com>2015-09-11 14:30:00 -0400
committerJoe George <joe@zeroc.com>2015-09-11 14:30:00 -0400
commitb9c2a6f6628476f11c78a7de2adc90edca1e209e (patch)
treedf192d87dfbc594a7a2b52a96b5145ad3156d26f /cpp/src/Ice/ConnectionFactory.cpp
parentICE-6645 Removed hack to keep binary compatibility in Ice 3.6.1 (diff)
parentRemoved ARM configuraton from WinRT testsuite solutions (diff)
downloadice-b9c2a6f6628476f11c78a7de2adc90edca1e209e.tar.bz2
ice-b9c2a6f6628476f11c78a7de2adc90edca1e209e.tar.xz
ice-b9c2a6f6628476f11c78a7de2adc90edca1e209e.zip
Merge remote-tracking branch 'origin/3.6'
Diffstat (limited to 'cpp/src/Ice/ConnectionFactory.cpp')
-rw-r--r--cpp/src/Ice/ConnectionFactory.cpp37
1 files changed, 33 insertions, 4 deletions
diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp
index ec04336d76c..a0faafc6145 100644
--- a/cpp/src/Ice/ConnectionFactory.cpp
+++ b/cpp/src/Ice/ConnectionFactory.cpp
@@ -1222,6 +1222,7 @@ IceInternal::IncomingConnectionFactory::flushAsyncBatchRequests(const Communicat
bool
IceInternal::IncomingConnectionFactory::startAsync(SocketOperation)
{
+ assert(_acceptor);
if(_state >= StateClosed)
{
return false;
@@ -1245,6 +1246,7 @@ IceInternal::IncomingConnectionFactory::startAsync(SocketOperation)
bool
IceInternal::IncomingConnectionFactory::finishAsync(SocketOperation)
{
+ assert(_acceptor);
try
{
_acceptor->finishAccept();
@@ -1295,6 +1297,11 @@ IceInternal::IncomingConnectionFactory::message(ThreadPoolCurrent& current)
_connections.erase(*p);
}
+ if(!_acceptor)
+ {
+ return;
+ }
+
//
// Now accept a new connection.
//
@@ -1411,7 +1418,14 @@ IceInternal::IncomingConnectionFactory::toString() const
{
return _transceiver->toString();
}
- return _acceptor->toString();
+ else if(_acceptor)
+ {
+ return _acceptor->toString();
+ }
+ else
+ {
+ return string();
+ }
}
NativeInfoPtr
@@ -1421,9 +1435,14 @@ IceInternal::IncomingConnectionFactory::getNativeInfo()
{
return _transceiver->getNativeInfo();
}
-
- assert(_acceptor);
- return _acceptor->getNativeInfo();
+ else if(_acceptor)
+ {
+ return _acceptor->getNativeInfo();
+ }
+ else
+ {
+ return 0;
+ }
}
void
@@ -1705,6 +1724,7 @@ IceInternal::IncomingConnectionFactory::createAcceptor()
if(_acceptor)
{
_acceptor->close();
+ _acceptor = 0;
}
throw;
}
@@ -1722,4 +1742,13 @@ IceInternal::IncomingConnectionFactory::closeAcceptor()
}
_acceptor->close();
+
+#if TARGET_OS_IPHONE != 0
+ //
+ // Only clear the acceptor on iOS where it can be destroyed/re-created during the lifetime of the incoming
+ // connection factory. On other platforms, we keep it set. This is in particular import for IOCP/WinRT where
+ // finishAsync can be called after the acceptor is closed.
+ //
+ _acceptor = 0;
+#endif
}