From 14e46bc24e79df49bd603c08d293c17245b9ca93 Mon Sep 17 00:00:00 2001 From: Michi Henning Date: Fri, 29 Aug 2003 06:51:58 +0000 Subject: Removed ice_flush() from proxy base class and implemented Communicator::flushBatchRequests(). --- cpp/src/Ice/ConnectionFactory.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'cpp/src/Ice/ConnectionFactory.cpp') 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 c; + { + IceUtil::Monitor::Lock sync(*this); + + for(std::multimap::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 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 { -- cgit v1.2.3