summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ConnectionFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/ConnectionFactory.cpp')
-rw-r--r--cpp/src/Ice/ConnectionFactory.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp
index 6661b7322b2..ae99f562611 100644
--- a/cpp/src/Ice/ConnectionFactory.cpp
+++ b/cpp/src/Ice/ConnectionFactory.cpp
@@ -380,6 +380,23 @@ IceInternal::OutgoingConnectionFactory::removeAdapter(const ObjectAdapterPtr& ad
}
}
+void
+IceInternal::OutgoingConnectionFactory::flushBatchRequests()
+{
+ list<ConnectionPtr> c;
+ {
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+
+ for(std::multimap<EndpointPtr, ConnectionPtr>::const_iterator p = _connections.begin();
+ p != _connections.end();
+ ++p)
+ {
+ c.push_back(p->second);
+ }
+ }
+ for_each(c.begin(), c.end(), Ice::voidMemFun(&Connection::flushBatchRequest));
+}
+
IceInternal::OutgoingConnectionFactory::OutgoingConnectionFactory(const InstancePtr& instance) :
_instance(instance),
_destroyed(false)
@@ -493,6 +510,13 @@ IceInternal::IncomingConnectionFactory::connections() const
return result;
}
+void
+IceInternal::IncomingConnectionFactory::flushBatchRequests()
+{
+ list<ConnectionPtr> c = connections(); // connections() is synchronized, so need to synchronize here.
+ for_each(c.begin(), c.end(), Ice::voidMemFun(&Connection::flushBatchRequest));
+}
+
bool
IceInternal::IncomingConnectionFactory::datagram() const
{